As an experiment. Note that online compilers are not compliant implementations although they use compliant compilers as their backends (this is just for fun)
Code:
#include <stdio.h>
#if defined(__clang__)
static const char *cn = "clang";
#elif defined(__ICC) || defined(__INTEL_COMPILER)
static const char *cn = "intel";
#elif defined(__GNUC__) || defined(__GNUG__)
static const char *cn = "gcc";
#else
static const char *cn = "unknown";
#endif
int main(void)
{
printf("%s\n", cn);
#if defined(__GNUC__)
printf("v %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#ifdef __STRICT_ANSI__
printf("Strict ANSI\n");
#endif
#endif
printf("File: %s\n", __FILE__);
}
for ideone, this does return a non-zero number and
Codepad still not working, but from the about page:
Code:
C: gcc 4.1.2
flags: -O -fmessage-length=0 -fno-merge-constants -fstrict-aliasing -fstack-protector-all