This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: long long, C++ testsuite and -ansi -pedantic-errors


Mark Mitchell wrote:
> 
> >>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
> 
>     Gabriel> G++ does accept long long with just a warning (a
>     Gabriel> pedwarn); and that is fine.
> 
>     Gabriel> The point here is that -pedantic-errors is documented as:
>     Gabriel> -pedantic-errors Like -pedantic, except that errors are
>     Gabriel> produced rather than warnings.
> 
> Thanks for explaining this carefully.  I agree with you;
> -pedantic-errors should be pedantic and issue errors, so pedantically
> complaining about long long is reasonable with those flags.
> 
> But there's still the issue of how to run the testsuite.  I think Mike
> made a concrete suggestion (turn off the error).  What do you suggest
> instead?

Sorry for butting in, but here's my $.02:

IMHO H.J.'s suggestion (wrap the long long stuff in __STRICT_ANSI__)
is a step in the right direction. This is indeed something that must
be fixed in the library, not in the test suite. AFAIK `long long' is
ill formed in C++, and requires a diagnostic (in conforming mode).

I propose the following:

    * -ansi or no option: provide long long stuff, don't warn about long long;
    * -ansi -pedantic: don't provide long long stuff, warn about long long;
    * -ansi -pedantic_errors: don't provide long long, emit error for long long.

I think the warnings/errors already work like that. All we need is a way
to check for -pedantic or -pedantic_errors; __STRICT_ANSI__ isn't enough,
and we can't use __extension__ to get this behaviour.

    Brane

-- 
Branko Čibej                 <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49     fax: (+386 1) 586 52 70

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]