Comment

Comment by kazinator

1. There is no <memory.h> in any version of ISO C, nor in POSIX.

2. This is not C89; at best GNU C 89, because a variable is declared after a statement:

   {
     if( msgLen == 0 )
        msgLen = 1;
     /* queueLen == 0 is an unbuffered channel, but we still need one slot to transport the message */
     CspChan_t* c = (CspChan_t*)malloc(sizeof(CspChan_t) + queueLen*msgLen);
To help enforce that you're actually writing C89, you should set your compiler to C89 and turn on whatever additional diagnostics may be required like -pedantic.
parent kazinator 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton