3 ms·
Edit: Nevermind. I had an extra space so my experiment was flawed. So, I tried it with gcc and clang, and neither did anything strange. Also tried -std=c99 a
by smcameron 4y ago
Edit: Nevermind. I had an extra space so my experiment was flawed.
So, I tried it with gcc and clang, and neither did anything strange.
Also tried -std=c99 and -std=c89. All behaved the same.
I thought maybe my distro had some default option configured to turn of trigraphs/digraphs, but --verbose didn't seem to show anything suspicious.
$ cat garbage.c
# include<stdio.h>
int main()
{
puts("What?? (really)");
return 0;
}
$ clang -std=c11 -o garbage garbage.c
$ ./garbage
What?? (really)
$ clang -std=c99 -o garbage garbage.c
$ ./garbage
What?? (really)
$ man gcc
$ clang -std=c89 -o garbage garbage.c
$ ./garbage
What?? (really)
$ gcc -std=c11 -o garbage garbage.c
$ ./garbage
What?? (really)
$ gcc -std=c99 -o garbage garbage.c
$ ./garbage
What?? (really)
$ gcc -std=c89 -o garbage garbage.c
$ ./garbage
What?? (really)
$
- GrumpySloth 4y agoYou need to get rid of the space between “??” and “(“.