Standard identification of compilers?

Joe Huffman joe at proto.com
Wed May 8 02:11:28 AEST 1991


cimshop!davidm at uunet.UU.NET (David S. Masterson) writes:

>Does the proposed standard (C or C++) have a way of identifying whose compiler
>is being used?  I know its bad form to build code specific to a compiler when
>that compiler conforms to a standard, but it seems that every compiler has its
>little quirks that are specific to it.  What I was wondering was if one could:

>	#if (__COMPILER__ == "BC++ v2.02")
>		...
>	#endif

I think your suggestion needs some modification... The test shown will generate
a syntax error no matter what __COMPILER__ is defined to (an integer constant
expression is expected).

You might just compile a list of what the different vendors use for 
identification.  Zortech uses __ZTC__ which expands to the version number in
hex.  For example: version 2.18 would have __ZTC__ equal to 0x218.
-- 
joe at proto.com



More information about the Comp.std.c mailing list