C: Compiler info at runtime?

Up vote 8 down vote favorite share g+ share fb share tw.

C compiler link|improve this question asked Jul 9 '10 at 11:32Shinka433511 100% accept rate.

You can do this with the pre-processor: Reference: predef.sourceforge.net/precomp.html For gcc: #if defined(__GNUC__) # if defined(__GNUC_PATCHLEVEL__) # define __GNUC_VERSION__ (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) # else # define __GNUC_VERSION__ (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100) # endif #endif For MSVC just use: _MSC_FULL_VER.

1: you beat me too it ;) – D. Shawley Jul 9 '10 at 11:40 Err... What if I used microsoft's compilers? – Arafangion Jul 9 '10 at 12:05 _MSC_FULL_VER Take a look at the link.

It's a reference for compiler specific pre processor defines. – Corporate Man Jul 9 '10 at 12:19.

No, the way to get the name of the compiler is itself compiler-specific :-P. Gcc provides the __VERSION__ macro, though.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions