Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C99 or C11?

Name: Anonymous 2013-12-29 4:40

Serious topic. No mention of C89 as it is objectively inferior to C99.

Name: Anonymous 2014-04-13 23:53

>>12
Actually, I like bools for the exact reason that Linus dislikes them - the implicit casting rules. I like being able to write

bool x;
int y;
x = y;


instead of

unsigned char x; /* Boolean */
int y;
x = !!y;


Having _Bool is especially useful as a defense against morons who would otherwise do stuff like

#define TRUE 1
#define FALSE 0

unsigned char x = 2;

if (x == TRUE)
/* Test fails */

if (x)
/* Test succeeds */


>>16
That's not too surprising given the way const actually works. I think I can agree that _Static_assert is pretty useless given that

#define EXAMPLE 5
#if EXAMPLE != 5
#error HURR COMPILE ERROR
#endif


has worked for ages. In fact the only practical case I can think of where it doesn't work is where EXAMPLE is an enum constant.

The only C11 feature I can actually get behind is cross-platform atomics. The language has really needed something like that for a while now.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List