Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fastest c/c++ compilers

Name: Anonymous 2010-09-26 10:35

In your opinion, how would you compare the speed of the programs produced by the MSVC, GCC and ICC C/C++ compilers?

Name: Anonymous 2010-09-26 19:45

>>17
There is no such thing as a C++ compiler, because no compiler fully implements the C++ standard.
There is no such thing as a C99 compiler, because no compiler fully implements the C99 standard.
There is no such thing as a faggot because you do not implement the anus standard.

C++ is not a superset of C.  It's just very similar.  GCC has pretty good C99 support, and there are some very nice things in C99 that just don't work in C++.  (You may say they'll be in Cocks, but by the time Cocks is supported it'll be compared to C1x instead of C99.)

NOT ALL C CODE COMPILES AS C++


$ cat test.c
#include <stdlib.h>
int main(int argc, char *argv[]) {
    int *p = malloc(sizeof(*p) * 100);
    return 0;
}
$ gcc test.c
$ g++ test.c
test.c: In function ‘int main(int, char**)’:
test.c:3:37: error: invalid conversion from ‘void*’ to ‘int*’


You have to go in and add casts to all the "malloc" calls.  Replacing it with "new" would not work because "new" throws exceptions when it fails.

NOT ALL C CODE GIVES THE SAME RESULTS WHEN COMPILED AS C++


$ cat test.c
#include <stdio.h>
int main(int argc, char *argv[]) {\
    printf("%zu\n", sizeof('a'));
    return 0;
}
$ gcc test.c ; ./a.out
4
$ g++ test.c ; ./a.out
1

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List