Find the answer to your Linux question:
Results 1 to 2 of 2
I have heard that gcc/g++ is not good enough. It allows a lot of stuff that it shouldn't; i.e int x=5; int a[x]; Are there any other good compiler out ...
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5

    Best compiler for C/C++?

    I have heard that gcc/g++ is not good enough. It allows a lot of stuff that it shouldn't; i.e

    int x=5;
    int a[x];

    Are there any other good compiler out there?

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    121
    Quote Originally Posted by huckleberry View Post
    I have heard that gcc/g++ is not good enough.
    Good enough for what? It's definitely not very good as an airbag. Darn walls.


    Quote Originally Posted by huckleberry View Post
    It allows a lot of stuff that it shouldn't; i.e

    int x=5;
    int a[x];

    Are there any other good compiler out there?
    1. There have been a lot of extensions made to C. Pretty much all compilers allow things they "shouldn't". Whether that makes the compiler less "good" is a matter of opinion.
    2. You can get gcc to be standards compliant by using the -pedantic flag. If you want to conform to a particular ISO C standard, you also need to specify -std=c89 or -std=c99 (the default is -std=gnu89, i.e. C89 with GNU extensions such as the variable-length array you demonstrated above).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...