Due to server problems the website is temporarily offline! Visit http://www.smorgasbordet.com/pellesc/ to download Pelles C.
#include <string.h>#include <stdio.h>static char foo[1024];int main(int argc, char * argv[]){ size_t n; char * x; if (argc < 2) return -1; n = strlen(argv[1]); strcpy(foo, argv[1]); #ifdef USE_VAR x = (n >= 4 && strcmp(&foo[n - 4], ".bar") == 0) ? &foo[n - 4] : &foo[n]; strcpy(x, ".baz");#else strcpy((n >= 4 && strcmp(&foo[n - 4], ".bar") == 0) ? &foo[n - 4] : &foo[n], ".baz");#endif printf("Result: %s\n", foo); return 0;}
test.c(21): warning #2242: Call to 'strcmp' removed. <-- WHY???test.c(9): warning #2114: Local 'x' is not referenced.test.c(6): fatal error: Internal error: 'Access violation' at 0x004a8b9c.