[OT] Re: program that compiles in C but not in C++?

From: Arthur J. O'Dwyer (ajo_at_nospam.andrew.cmu.edu)
Date: 01/11/04

  • Next message: Arthur J. O'Dwyer: "Re: [C++] Encryption statistic)"
    Date: Sat, 10 Jan 2004 20:55:57 -0500 (EST)
    
    

    On Sun, 11 Jan 2004, Martijn Lievaart wrote:
    >
    > On Sat, 10 Jan 2004 17:38:36 +0000, Richard Heathfield wrote:
    > [Martijn wrote:]
    > >> So it follows that g++ is only compliant if used with --pedantic?

    > > [I]t does indeed appear that g++ is not conforming without the
    > > pedantic switch. (That doesn't mean it /is/ conforming /with/ the switch,
    > > on which I offer no opinion.)
    >
    > Yes, bad wording on my part. I ment compliant in this area of course.
    > Thanks for the confirmation. I filed a bug report.

      This is OT here (gnu.gcc.* would seem appropriate), but I'm almost
    positive that the GCC folks don't consider that a "bug," but a feature.
    gcc is not *supposed* to be a conforming C compiler in any mode but
    -ansi -pedantic, and possibly not even then. By default gcc compiles
    a dialect known as "GNU C" that has several extensions to the standard
    language. You shouldn't expect it to conform unless you give it the
    -ansi option (which IIRC means --std=c89) or the --std=c99 option, and in
    the latter case it *still* won't be conforming.

    -Arthur


  • Next message: Arthur J. O'Dwyer: "Re: [C++] Encryption statistic)"

    Relevant Pages

    • Re: [OT] lcc first experience
      ... GCC does embrace-and-extend? ... affect the behaviour of a strictly conforming program. ... Of course if implementations are called "lcc-win" you will start ranting ... making them 100% compatible with the C standard. ...
      (comp.lang.c)
    • Re: [kde] Problem compiling extragear/graphics/digikam/libs/dmetadata/loaders/dmetaloader.cpp
      ... I am running Fedora Core 5. ... Are you using GCC 4.x? ... In that case you'd better file a bug report ... Steps to Reproduce: ...
      (KDE)
    • Re: [PATCH] 6700/6702PXH quirk
      ... > the generated asm from gcc on ARM or MIPS demonstrates the explosion of ... > do bitfields than machine ints. ... bug report is in order and gcc should be fixed. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Difference between C89 and C99?
      ... do you claim that gcc is a conforming C99 compiler? ...
      (comp.lang.c)
    • Re: Meaning of the warning
      ... Not a bug. ... You may be complaining that gcc ... compilers are allowed to emit all ... conforming), but that it issues an error message and refuses to compile ...
      (comp.lang.c)