1. why isn't __STDC__ being defined?
I'm having a problem with a header file believing that when gcc sometimes
incorrectly defines __STDC__ :
#if (defined(__STDC__) && (!defined(sun) || defined(__svr4__)))
ie, Solaris (which defines __svr4__) is OK, but sunos is not (I guess).
But gcc isn't defining __STDC__ !
From the non-bugs section of gcc's info (and I'm sure you gurus know
Currently, GNU CC defines `__STDC__' as long as you don't use
`-traditional'. This provides good results in practice.
Programmers normally use conditionals on `__STDC__' to ask whether
it is safe to use certain features of ANSI C, such as function
prototypes or ANSI token concatenation. Since plain `gcc' supports
all the features of ANSI C, the correct answer to these questions
Some users try to use `__STDC__' to check for the availability of
certain library facilities. This is actually incorrect usage in
an ANSI C program, because the ANSI C standard says that a
conforming freestanding implementation should define `__STDC__'
even though it does not have the library facilities. `gcc -ansi
-pedantic' is a conforming freestanding implementation, and it is
therefore required to define `__STDC__', even though it does not
come with an ANSI C library.
"gcc -ansi -pedantic ... required to define `__STDC__'".
Why then, do I get this:
bash-2.01# uname -a
SunOS foobar 5.6 Generic sun4m sparc SUNW,SPARCstation-10
bash-2.01# > a.c
bash-2.01# gcc -E -dM -ansi -pedantic a.c
#define __STRICT_ANSI__ 1
#define __GCC_NEW_VARARGS__ 1
#define __sparc 1
#define __svr4__ 1
#define __GNUC_MINOR__ 8
#define __sun 1
#define __sun__ 1
#define __unix 1
#define __unix__ 1
#define __SVR4 1
#define __GNUC__ 2
#define __sparc__ 1
(gcc-2.8.0; Solaris 2.6)
thanks for any help. (please cc: my email; I might miss your post)
2. M88K <--> SCO with optical drive
3. gcc #define #define #define
4. Setup Canon Image Runner 210S
5. Bash's `continue' isn't continuing
6. UPDATE: Diamond Video Card Listing, version 2
7. 'who' Shows telnet login When There Isn't One
8. KDE Startup Problems
9. Wildcard pattern '*~' isn't interpreted in script (with rsync)
10. '/dev/hdxx is mounted' when it isn't
11. There goes the old 'linux isn't vulnerable' argument..
12. sendmail and it's message: "database '@' has not been defined"
13. select() says there's data, read() says there isn't