man gcc doesn't mention -std=c90

Discussion in 'C Programming' started by learnerlone@gmail.com, Aug 12, 2012.

  1. Guest

    This is what the man page for gcc tells me regarding -std options for the C language:

    -std=
    Determine the language standard. This option is
    currently only supported when compiling C or C++.

    The compiler can accept several base standards, such
    as c89 or c++98, and GNU dialects of those standards,
    such as gnu89 or gnu++98. By specifying a base
    standard, the compiler will accept all programs
    following that standard and those using GNU
    extensions that do not contradict it. For example,
    -std=c89 turns off certain features of GCC that are
    incompatible with ISO C90, such as the "asm" and
    "typeof" keywords, but not other GNU extensions that
    do not have a meaning in ISO C90, such as omitting
    the middle term of a "?:" expression. On the other
    hand, by specifying a GNU dialect of a standard, all
    features the compiler support are enabled, even when
    those features change the meaning of the base
    standard and some strict-conforming programs may be
    rejected. The particular standard is used by
    -pedantic to identify which features are GNU
    extensions given that version of the standard. For
    example -std=gnu89 -pedantic would warn about C++
    style // comments, while -std=gnu99 -pedantic would
    not.

    A value for this option must be provided; possible
    values are

    c89
    iso9899:1990
    Support all ISO C90 programs (certain GNU
    extensions that conflict with ISO C90 are
    disabled). Same as -ansi for C code.

    iso9899:199409
    ISO C90 as modified in amendment 1.

    c99
    c9x
    iso9899:1999
    iso9899:199x
    ISO C99. Note that this standard is not yet
    fully supported; see
    <http://gcc.gnu.org/gcc-4.4/c99status.html> for
    more information. The names c9x and iso9899:199x
    are deprecated.

    gnu89
    GNU dialect of ISO C90 (including some C99
    features). This is the default for C code.

    gnu99
    gnu9x
    GNU dialect of ISO C99. When ISO C99 is fully
    implemented in GCC, this will become the default.
    The name gnu9x is deprecated.

    But at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html I learnt that -std=c90 is synonymous to -ansi. I have confirmed that -c89 and -c90 both work with my compiler but I can't understand why the man page doesn't mention -c90.

    My gcc version:

    $ gcc --version
    gcc (Debian 4.7.1-2) 4.7.1
    Copyright (C) 2012 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    , Aug 12, 2012
    #1
    1. Advertising

  2. James Kuyper Guest

    On 08/12/2012 07:32 AM, wrote:
    ....
    > But at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html I learnt that -std=c90 is synonymous to -ansi. I have confirmed that -c89 and -c90 both work with my compiler but I can't understand why the man page doesn't mention -c90.


    That's a defect in the gcc documentation, and I would recommend
    reporting it at <http://gcc.gnu.org/bugzilla>. Even better, volunteer to
    fix it - they'll be very happy to accept your help, and fixing such
    documentation issues doesn't require as much specialized knowledge as
    solving software defects.

    This is not the best forum for discussing compiler-specific issues, it
    is for discussion of the C language itself, regardless of which compiler
    is used.
    --
    James Kuyper
     
    James Kuyper, Aug 12, 2012
    #2
    1. Advertising

  3. James Kuyper <> writes:

    > On 08/12/2012 07:32 AM, wrote:
    > ...
    >> But at http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html I
    >> learnt that -std=c90 is synonymous to -ansi. I have confirmed that
    >> -c89 and -c90 both work with my compiler but I can't understand why
    >> the man page doesn't mention -c90.

    >
    > That's a defect in the gcc documentation, and I would recommend
    > reporting it at <http://gcc.gnu.org/bugzilla>.


    My version (4.6.3) lists -std=c90 as an alternative, so it's been
    fixed. If the OP's version is widely used it may still be worth fixing
    but I'd say it's low priority.

    <snip>
    --
    Ben.
     
    Ben Bacarisse, Aug 12, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe777

    I forgot to mention...

    Joe777, May 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    341
    Joe Van Meer
    May 6, 2004
  2. mglover

    forgot to mention

    mglover, Jul 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    826
    Bobby Ryzhy
    Jul 22, 2004
  3. Richard

    forgot to mention

    Richard, Jan 9, 2004, in forum: HTML
    Replies:
    0
    Views:
    402
    Richard
    Jan 9, 2004
  4. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,995
    Thomas Stegen
    Jun 28, 2003
  5. Jaap Karssenberg

    conflict between man perlipc and man perlfunc !?

    Jaap Karssenberg, Jan 9, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    163
    Jaap Karssenberg
    Jan 9, 2004
Loading...

Share This Page