Click to See Complete Forum and Search --> : A Question about "__STDC__ ".


George Ma
August 30th, 2002, 06:25 AM
Hi, everyone!

I wondered where the variable __STDC__ is defined.
I write a simple C program to test it, before include
other .h files, the variable is already defined.
(I use #ifdef to test the existence)

I have two question about the variable:

1. Where is the variable defined?

2. What is the function of the variable?


Cheers,
George

cup
August 30th, 2002, 08:51 AM
1) __STDC__ is normally defined in a compiler option. For VC++ it will be something like /Za or /Ze.

2) It is used to disable vendor extensions like interrupt or asm. If you are in that mode, the code should be portable across systems.