Subject: Re: gcc-ansi -pedantic and long long on NetBSD
To: None <current-users@NetBSD.ORG>
From: Bert Driehuis <driehuis@indy.knoware.nl>
List: current-users
Date: 10/31/1994 20:19:06
Allan Barret wrote:
>There is also a less obvious solution:  Add a compiler option to stop
>complaining about the use of "long long" in system include files, or
>where it results from the use of a typedef that was defined in a system
>include file (but to continue to complain about use of "long long"
>elsewhere).  Perhaps even make such suppression of warnings the default,
>with an option to turn the warnings on.

This is what VMS does. It has #pragma nostandard and #pragma standard to
wrap non-ANSI compliant parts of their include files in, to allow for
really devious extensions like anonymous unions (you need 'm on VMS,
believe me :-) and other dubious constructs, like taking the address of a
constant (which you need in VMS as well), and constructs for talking to the
linker (which VMS needs in defience of ANSI C).

At any rate, the idea is nice if you take as a given that you need language
extensions like "long long" for off_t in system header files, but wish to
keep your own code standards conforming.

If one were to implement a pragma "ignore_pedantic", then please do it
right, and properly define the semantics of them (although according to RMS
there is no right way to do pragmas -- remember "emacs hanoi 9"?). I
personally consider it an error if any #pragma ignore_pedantic .. #pragma
noignore_pedantic crosses file boundaries, either going deeper or going up,
since you have no control over (and thus no knowledge of) the correctness
and standards conformance of other files than the one you declare the
pragma in.

Oh well -- pragma's have been debated for over eight years now, and I'd
just as soon leave this can of worms unopened... As the GCC info file
states: the
-pedantic option is only there to satisfy pedants (and we wouldn't like to
be called *that*, would we? :-)

Just my two cents.

                                        -- Bert Driehuis

------
Bert Driehuis                 God, grant me the serenity to accept the things
driehuis@utrecht.knoware.nl   I can't change, courage to change the things I
                              can, and the wisdom to know the difference.