Giter VIP home page Giter VIP logo

c89thread's Introduction

David Reid

Open source C and C++ developer focusing on small, easy to use libraries with no dependencies and simple build systems.

discord mastodon

c89thread's People

Contributors

mackron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hackerdagreat57

c89thread's Issues

Compile errors on Clang and GCC

I am unable to use the library with Clang or GCC on Linux, these are the errors:

With clang:

./c89thread.h:1411:9: error: use of undeclared identifier 'pSem'; did you mean 'sem'?
    if (pSem->value < pSem->valueMax) {
        ^~~~
        sem
./c89thread.h:1398:27: note: 'sem' declared here
int c89sem_post(c89sem_t* sem)
                          ^
./c89thread.h:1411:23: error: use of undeclared identifier 'pSem'; did you mean 'sem'?
    if (pSem->value < pSem->valueMax) {
                      ^~~~
                      sem
./c89thread.h:1398:27: note: 'sem' declared here
int c89sem_post(c89sem_t* sem)
                          ^
./c89thread.h:1412:9: error: use of undeclared identifier 'pSem'
        pSem->value += 1;
        ^
./c89thread.h:1413:30: error: use of undeclared identifier 'pSem'; did you mean 'sem'?
        pthread_cond_signal(&pSem->cond);
                             ^~~~
                             sem
./c89thread.h:1398:27: note: 'sem' declared here
int c89sem_post(c89sem_t* sem)
                          ^
./c89thread.h:1566:5: error: void function 'c89timespec_get' should not return a value [-Wreturn-type]
    return timespec_get(ts, base);
    ^      ~~~~~~~~~~~~~~~~~~~~~~

With GCC:

c89thread.h: In function ‘c89sem_post’:
c89thread.h:1411:9: error: ‘pSem’ undeclared (first use in this function)
 1411 |     if (pSem->value < pSem->valueMax) {
      |         ^~~~
c89thread.h:1411:9: note: each undeclared identifier is reported only once for each function it appears in
c89thread.h: In function ‘c89timespec_get’:
c89thread.h:1566:12: warning: ‘return’ with a value, in function returning void [-Wreturn-type]
 1566 |     return timespec_get(ts, base);
      |            ^~~~~~~~~~~~~~~~~~~~~~
c89thread.h:1564:6: note: declared here
 1564 | void c89timespec_get(struct timespec* ts, int base)
      |      ^~~~~~~~~~~~~~~

Also when I compile with -std=c99 or -std=c89 more error and warnings appears, so the library does not really work with C89 on Linux.

Compile error on MSVC

I get this compile error when using the library with Visual Studio 2019.

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0513	a value of type "void *" cannot be assigned to an entity of type "c89thrd_start_data_win32 *"	ConsoleApplication1	C:\Users\kenfal\source\repos\ConsoleApplication1\ConsoleApplication1\c89thread.h	345	
Error	C2440	'=': cannot convert from 'void *' to 'c89thrd_start_data_win32 *'	ConsoleApplication1	C:\Users\kenfal\source\repos\ConsoleApplication1\ConsoleApplication1\c89thread.h	345	
Message		Conversion from 'void*' to pointer to non-'void' requires an explicit cast	ConsoleApplication1	C:\Users\kenfal\source\repos\ConsoleApplication1\ConsoleApplication1\c89thread.h	345	

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.