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


> 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).

It is ill-formed in application code; the C++ library is part of the
implementation (of C++), and therefore can do whatever it pleases.

I believe putting __extension__ in that please would be the correct
solution. It would be incorrect, if

a) there is a well-formed program that won't behave conforming due to
   the presence  operator<<(long long), or

b) there is an ill-formed program that won't be diagnosed as such,
   because of that operator.

I believe a) is not the case, since that operator will never be
invoked in a conforming program. b) is not the case because an
ill-formed program had to declare an object of type long long to use
this operator (or a conversion function, or so). Such declarations
would themselves be diagnosed, so there is really no problem with
using __extension__ in the library.

Regards,
Martin

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