r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Andreas
23-Feb-2012
[2917]
A slightly better test would be:

#include <stdio.h>

int main(int argc, char *argv[]) {printf("%ld\n", sizeof(_Bool)); 
return 0;}


And then compile that in C99 mode (i.e. -std=c99 for GCC; but C89/90 
compilers will bark on the unknown _Bool keyword anyway).


Better, because there exist(ed) a few stdbool.h versions prior to 
the final C99 standard which used e.g. unsigned integers for bools. 
Should be gone/fixed by now, but one never knows :)
Geomol
23-Feb-2012
[2918]
Under OS X using gcc, I get bool length 1 both with Cyphre and Andreas 
versions, and also with or without -std=c99 option.
Cyphre
23-Feb-2012
[2919:last]
Yes, I also used the C99 compiler flag. Andreas version is more correct 
test ofcourse.