Created
July 3, 2020 13:47
-
-
Save cdcme/0b74b860b52c6b03a8f8d81a384058a5 to your computer and use it in GitHub Desktop.
Print out C development environment info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prints local development environment information | |
void environs() { | |
#ifdef __clang_major__ | |
printf ("clang detected version %d.%d\n", __clang_major__, __clang_minor__); | |
#endif | |
#ifdef __GNUC__ | |
// note that clang 3.7 declares itself as a gcc 4.2" | |
printf ("gcc detected version %d.%d\n", __GNUC__, __GNUC_MINOR__); | |
#endif | |
#if __STDC_VERSION__ >= 201710L | |
printf("We are using C18!\n"); | |
#elif __STDC_VERSION__ >= 201112L | |
printf("We are using C11!\n"); | |
#elif __STDC_VERSION__ >= 199901L | |
printf("We are using C99!\n"); | |
#else | |
printf("We are using C89/C90!\n"); | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment