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

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun Jun 18 10:34:00 GMT 2000


> 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


More information about the Gcc mailing list