This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Long Long Int and gcc2.95
- To: mckelvey at fafnir dot com
- Subject: Re: Long Long Int and gcc2.95
- From: Gabriel Dos_Reis <Gabriel dot Dos_Reis at sophia dot inria dot fr>
- Date: 09 Aug 1999 05:48:42 +0200
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: I.N.R.I.A Sophia-Antipolis (France)
- References: <199908090334.UAA26315@fafnir.com>
- Reply-To: gcc-bugs at gcc dot gnu dot org
James McKelvey <mckelvey@fafnir.com> writes:
| gcc 2.95:
|
| In iostream.h, long long int operators are guarded by:
|
| #if defined(__GNUC__)
| __extension__ ostream& operator<<(long long n);
| __extension__ ostream& operator<<(unsigned long long n);
| #endif
|
| But in the .cc file, by:
|
| #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
| ostream& ostream::operator<<(long long n)
|
| Is there a reason for this inconsistency? I'd like to use long long int with
| -ansi, so I specify -Wno-long-long. But that no longer works, because the
| code is no longer in the library. It worked OK in egcs 1.1.2.
Well, since the actual trend is toward ISO C++ conformance, I'd say
that if you turn on -ansi then you can't use 'long long'. So the
obvious fix I see is
- in the header:
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
__extension__ ostream& operator<<(long long n);
__extension__ ostream& operator<<(unsigned long long n);
#endif
- in the .cc
#if defined(__GNUC__)
__extension__ ostream& ostream::operator<<(long long n);
ostream& ostream::operator<<(long long n)
// ....
#endif
-- Gaby