public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 18:31 Mike Stump
  2000-06-12 18:39 ` Marc Espie
  2000-06-12 19:09 ` Gabriel Dos Reis
  0 siblings, 2 replies; 31+ messages in thread
From: Mike Stump @ 2000-06-12 18:31 UTC (permalink / raw)
  To: gdr; +Cc: gcc, hjl

> To: Mike Stump <mrs@windriver.com>
> From: Gabriel Dos Reis <gdr@codesourcery.com>
> Date: 13 Jun 2000 03:06:39 +0200

> Even in 5 years, I'm not sure C++ will incorporate long long; and I
> can wait too :-)

I am.  No need to wait though.

> I think -ansi -pedantic should check for the language rules as
> currently defined.

Gosh, I'm so used to developing Standards and tracking Standards in
progress that I'd disagree.  I don't see a good reason to not track
Standards, when we are reasonably sure we know the direction they are
going in.  (No user burn.)

People that want older Standards, can always ask for them, if you want
to support that.

> Or we have to rename these options (or change their documentations).

I don't see the opinions or their documentation as wrong.  -fstd=
allows the ultimate in control, for those that need/want it.  I don't
see much benefit in having -ansi hang back.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 18:31 long long, C++ testsuite and -ansi -pedantic-errors Mike Stump
@ 2000-06-12 18:39 ` Marc Espie
  2000-06-12 19:09 ` Gabriel Dos Reis
  1 sibling, 0 replies; 31+ messages in thread
From: Marc Espie @ 2000-06-12 18:39 UTC (permalink / raw)
  To: mrs; +Cc: gcc

In article < 200006130131.SAA28812@kankakee.wrs.com > you write:
>> To: Mike Stump <mrs@windriver.com>
>> From: Gabriel Dos Reis <gdr@codesourcery.com>
>> Date: 13 Jun 2000 03:06:39 +0200

>> Even in 5 years, I'm not sure C++ will incorporate long long; and I
>> can wait too :-)

>I am.  No need to wait though.

>> I think -ansi -pedantic should check for the language rules as
>> currently defined.

>Gosh, I'm so used to developing Standards and tracking Standards in
>progress that I'd disagree.  I don't see a good reason to not track
>Standards, when we are reasonably sure we know the direction they are
>going in.  (No user burn.)

>People that want older Standards, can always ask for them, if you want
>to support that.

I believe that Gaby is quite used to tracking the C++ standard.
If he believes that C++ might not have `long long' after the next revision,
he might have good reason to do so.  

After all, he's part of the committee.

I know that the C++ committee had some harsh words about C99, I don't quite
remember the details, but C99 did break a few compatibilities routes for C++.

And I'm not too sure the next revision of the C++ standard will want to catch
up.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 18:31 long long, C++ testsuite and -ansi -pedantic-errors Mike Stump
  2000-06-12 18:39 ` Marc Espie
@ 2000-06-12 19:09 ` Gabriel Dos Reis
  2000-06-12 20:01   ` Mark Mitchell
  1 sibling, 1 reply; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-12 19:09 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc, hjl

Mike Stump <mrs@windriver.com> writes:

| > To: Mike Stump <mrs@windriver.com>
| > From: Gabriel Dos Reis <gdr@codesourcery.com>
| > Date: 13 Jun 2000 03:06:39 +0200
| 
| > Even in 5 years, I'm not sure C++ will incorporate long long; and I
| > can wait too :-)
| 
| I am.  No need to wait though.

Well, you aren't ISO/SC22/WG21.

What you happen to think is quite distinct from what the committee
will ultimately decide. 

| > I think -ansi -pedantic should check for the language rules as
| > currently defined.
| 
| Gosh, I'm so used to developing Standards and tracking Standards in
| progress that I'd disagree.  I don't see a good reason to not track
| Standards, when we are reasonably sure we know the direction they are
| going in.  (No user burn.)

The Standard in question here is ISO 14882. I, too, am tracking it.
There is no evidence, from the works being actively done, that shows
that 'long long' will be incorporated or not. And given the amount of
effort in negociating long long in C99, the reticence expressed by
some national bodies, I don't see why it is so obvious that long long
will be part of C++-2010.


| People that want older Standards, can always ask for them, if you want
| to support that.

ISO 14882 isn't an older Standard, and there is no new C++
definition. Even the TC has greaat pain to get out.


| > Or we have to rename these options (or change their documentations).
| 
| I don't see the opinions or their documentation as wrong. 

The documentation says:

-ansi
In C mode, support all ANSI standard C programs.  In C++ mode,
remove GNU extensions that conflict with ISO C++.

-pedantic
Issue all the warnings demanded by strict ANSI C and ISO C++;
reject all programs that use forbidden extensions.


Does 'long long' conflict with ISO C++? Yes, if no diagnostics is
issued. 

Users expects GCC to behave in accordance with its documentation.
We have no bussiness in feeding them with unfounded expectations.

If you do insist on having then I would suggest

	-behave-according-to-mike-s-speculations.

At least, the option would be self-descriptive and there would be no
need to document it.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 19:09 ` Gabriel Dos Reis
@ 2000-06-12 20:01   ` Mark Mitchell
  2000-06-12 20:39     ` H . J . Lu
  2000-06-13  1:01     ` Gabriel Dos Reis
  0 siblings, 2 replies; 31+ messages in thread
From: Mark Mitchell @ 2000-06-12 20:01 UTC (permalink / raw)
  To: gdr; +Cc: mrs, gcc, hjl

>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:

    Gabriel> 03:06:39 +0200 | | > Even in 5 years, I'm not sure C++
    Gabriel> will incorporate long long; and I | > can wait too :-) |
    Gabriel> | I am.  No need to wait though.

    Gabriel> Well, you aren't ISO/SC22/WG21.

    Gabriel> What you happen to think is quite distinct from what the
    Gabriel> committee will ultimately decide.

I've heard enough.  

This conversation is degrading into name-calling and is generating
ill-will, and there's no place for that on this list.  It is certainly
appropriate to discuss whether or not G++ should complain about `long
long', but not in this manner.

libstdc++ V3 needs to have a mode (and it probably does!) where `long
long' isn't use for compilers that don't accept it -- since they don't
need to at this point.  And g++ should probably accept it with a
warning, rather than issuing an error.  At least, that's my two cents;
I'd like to hear Jason's opinion.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 20:01   ` Mark Mitchell
@ 2000-06-12 20:39     ` H . J . Lu
  2000-06-12 21:25       ` Steven King
  2000-06-13  1:07       ` Gabriel Dos Reis
  2000-06-13  1:01     ` Gabriel Dos Reis
  1 sibling, 2 replies; 31+ messages in thread
From: H . J . Lu @ 2000-06-12 20:39 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gdr, mrs, gcc

On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
> 
> libstdc++ V3 needs to have a mode (and it probably does!) where `long
> long' isn't use for compilers that don't accept it -- since they don't
> need to at this point.  And g++ should probably accept it with a
> warning, rather than issuing an error.  At least, that's my two cents;
> I'd like to hear Jason's opinion.
> 

-ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
with __STRICT_ANSI__?


-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 20:39     ` H . J . Lu
@ 2000-06-12 21:25       ` Steven King
  2000-06-12 21:44         ` H . J . Lu
  2000-06-13  1:07       ` Gabriel Dos Reis
  1 sibling, 1 reply; 31+ messages in thread
From: Steven King @ 2000-06-12 21:25 UTC (permalink / raw)
  To: H . J . Lu; +Cc: gcc

On Mon, 12 Jun 2000, H . J . Lu wrote:
> On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
> > 
> > libstdc++ V3 needs to have a mode (and it probably does!) where `long
> > long' isn't use for compilers that don't accept it -- since they don't
> > need to at this point.  And g++ should probably accept it with a
> > warning, rather than issuing an error.  At least, that's my two cents;
> > I'd like to hear Jason's opinion.
> > 
> 
> -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
> with __STRICT_ANSI__?

  You can configure the library not to use long long; the default is to enable
long long where the target supports it. 

  Specifying -ansi will probably break things elsewhere in the library, atleast
for glibc; specifically, the cmath header expects to be able to use the c99
float and long double functions if the target has them.

 -- 
Steven King
sxking@uswest.net

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 21:25       ` Steven King
@ 2000-06-12 21:44         ` H . J . Lu
  2000-06-12 22:04           ` Steven King
  2000-06-13  0:39           ` Gabriel Dos Reis
  0 siblings, 2 replies; 31+ messages in thread
From: H . J . Lu @ 2000-06-12 21:44 UTC (permalink / raw)
  To: Steven King; +Cc: gcc

On Mon, Jun 12, 2000 at 09:05:53PM -0700, Steven King wrote:
> On Mon, 12 Jun 2000, H . J . Lu wrote:
> > On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
> > > 
> > > libstdc++ V3 needs to have a mode (and it probably does!) where `long
> > > long' isn't use for compilers that don't accept it -- since they don't
> > > need to at this point.  And g++ should probably accept it with a
> > > warning, rather than issuing an error.  At least, that's my two cents;
> > > I'd like to hear Jason's opinion.
> > > 
> > 
> > -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
> > with __STRICT_ANSI__?
> 
>   You can configure the library not to use long long; the default is to enable
> long long where the target supports it. 
> 

Why do I want to do that? I want long long in libstdc++.


H.J.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 21:44         ` H . J . Lu
@ 2000-06-12 22:04           ` Steven King
  2000-06-12 23:04             ` H . J . Lu
  2000-06-13  0:39           ` Gabriel Dos Reis
  1 sibling, 1 reply; 31+ messages in thread
From: Steven King @ 2000-06-12 22:04 UTC (permalink / raw)
  To: H . J . Lu; +Cc: gcc

On Mon, 12 Jun 2000, H . J . Lu wrote:
>
> Why do I want to do that? I want long long in libstdc++.

  Then why dont you just add -Wno-long-long to your cxxflags?

-- 
Steven King
sxking@uswest.net

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 22:04           ` Steven King
@ 2000-06-12 23:04             ` H . J . Lu
  0 siblings, 0 replies; 31+ messages in thread
From: H . J . Lu @ 2000-06-12 23:04 UTC (permalink / raw)
  To: Steven King; +Cc: gcc

On Mon, Jun 12, 2000 at 09:46:21PM -0700, Steven King wrote:
> On Mon, 12 Jun 2000, H . J . Lu wrote:
> >
> > Why do I want to do that? I want long long in libstdc++.
> 
>   Then why dont you just add -Wno-long-long to your cxxflags?
> 

The problem is the default setting doesn't work. Why should I
set -Wno-long-long?

H.J.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 21:44         ` H . J . Lu
  2000-06-12 22:04           ` Steven King
@ 2000-06-13  0:39           ` Gabriel Dos Reis
  2000-06-13  8:49             ` H . J . Lu
  1 sibling, 1 reply; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-13  0:39 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Steven King, gcc

"H . J . Lu" <hjl@lucon.org> writes:

| On Mon, Jun 12, 2000 at 09:05:53PM -0700, Steven King wrote:
| > On Mon, 12 Jun 2000, H . J . Lu wrote:
| > > On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
| > > > 
| > > > libstdc++ V3 needs to have a mode (and it probably does!) where `long
| > > > long' isn't use for compilers that don't accept it -- since they don't
| > > > need to at this point.  And g++ should probably accept it with a
| > > > warning, rather than issuing an error.  At least, that's my two cents;
| > > > I'd like to hear Jason's opinion.
| > > > 
| > > 
| > > -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
| > > with __STRICT_ANSI__?
| > 
| >   You can configure the library not to use long long; the default is to enable
| > long long where the target supports it. 
| > 
| 
| Why do I want to do that? I want long long in libstdc++.

v3 supports long long by default if the target has it.
The most convincing reason I've heard is that it is a system library.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 20:01   ` Mark Mitchell
  2000-06-12 20:39     ` H . J . Lu
@ 2000-06-13  1:01     ` Gabriel Dos Reis
  2000-06-13  7:34       ` Mark Mitchell
  1 sibling, 1 reply; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-13  1:01 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: mrs, gcc, hjl

Mark Mitchell <mark@codesourcery.com> writes:

[...]

| libstdc++ V3 needs to have a mode (and it probably does!) where `long
| long' isn't use for compilers that don't accept it -- since they don't
| need to at this point.  And g++ should probably accept it with a
| warning, rather than issuing an error.

Mark,

G++ does accept long long with just a warning (a pedwarn); and that
is fine. 

The point here is that -pedantic-errors is documented as:
-pedantic-errors
Like -pedantic, except that errors are produced rather than warnings.


I'm not advocating for not implementing long long in g++. I'm saying
we should be consistent with the documentation.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 20:39     ` H . J . Lu
  2000-06-12 21:25       ` Steven King
@ 2000-06-13  1:07       ` Gabriel Dos Reis
  2000-06-13  9:02         ` H . J . Lu
  1 sibling, 1 reply; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-13  1:07 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Mark Mitchell, mrs, gcc

"H . J . Lu" <hjl@valinux.com> writes:

| On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
| > 
| > libstdc++ V3 needs to have a mode (and it probably does!) where `long
| > long' isn't use for compilers that don't accept it -- since they don't
| > need to at this point.  And g++ should probably accept it with a
| > warning, rather than issuing an error.  At least, that's my two cents;
| > I'd like to hear Jason's opinion.
| > 
| 
| -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
| with __STRICT_ANSI__?

Please, note that it isn't -ansi that is causing the error. Using
`long long' in C++ results in a pedwarn. Then, turning a pedwarn into
an error is just behaviour as documented.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  1:01     ` Gabriel Dos Reis
@ 2000-06-13  7:34       ` Mark Mitchell
  2000-06-13  8:37         ` Branko
  2000-06-18 10:26         ` Martin v. Loewis
  0 siblings, 2 replies; 31+ messages in thread
From: Mark Mitchell @ 2000-06-13  7:34 UTC (permalink / raw)
  To: gdr; +Cc: mrs, gcc, hjl

>>>>> "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?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  7:34       ` Mark Mitchell
@ 2000-06-13  8:37         ` Branko
  2000-06-18 10:34           ` Martin v. Loewis
  2000-06-18 10:26         ` Martin v. Loewis
  1 sibling, 1 reply; 31+ messages in thread
From: Branko @ 2000-06-13  8:37 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gdr, mrs, gcc, hjl

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 &Ccaron;ibej                 <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49     fax: (+386 1) 586 52 70

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  0:39           ` Gabriel Dos Reis
@ 2000-06-13  8:49             ` H . J . Lu
  2000-06-13  9:00               ` Gabriel Dos Reis
  0 siblings, 1 reply; 31+ messages in thread
From: H . J . Lu @ 2000-06-13  8:49 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Steven King, gcc

On Tue, Jun 13, 2000 at 09:38:57AM +0200, Gabriel Dos Reis wrote:
> | > > 
> | > > -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
> | > > with __STRICT_ANSI__?
> | > 
> | >   You can configure the library not to use long long; the default is to enable
> | > long long where the target supports it. 
> | > 
> | 
> | Why do I want to do that? I want long long in libstdc++.
> 
> v3 supports long long by default if the target has it.
> The most convincing reason I've heard is that it is a system library.
> 

That becomes ridiculous. Are you saying if gcc is used as a system
compiler, the long long support in libstc++ v3 should be turned off?
Why not turn off the long long support in g++ altogether? glibc
is the system library for Linux. We have many extensions beyond
ISO C. I want the long long support in libstc++ v3 on Linux and 
I also want to run the testsuite with the default setting on Linux.


H.J.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  8:49             ` H . J . Lu
@ 2000-06-13  9:00               ` Gabriel Dos Reis
  0 siblings, 0 replies; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-13  9:00 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Gabriel Dos Reis, Steven King, gcc

"H . J . Lu" <hjl@lucon.org> writes:

| On Tue, Jun 13, 2000 at 09:38:57AM +0200, Gabriel Dos Reis wrote:
| > | > > 
| > | > > -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
| > | > > with __STRICT_ANSI__?
| > | > 
| > | >   You can configure the library not to use long long; the default is to enable
| > | > long long where the target supports it. 
| > | > 
| > | 
| > | Why do I want to do that? I want long long in libstdc++.
| > 
| > v3 supports long long by default if the target has it.
| > The most convincing reason I've heard is that it is a system library.
| > 
| 
| That becomes ridiculous. Are you saying if gcc is used as a system
| compiler, the long long support in libstc++ v3 should be turned off?

No.

I'm saying that it is reasonable to make libtsdc++-v3 support long
long, as a system library.

The testsuites should be run with the appropriate flags.

-- Gaby

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  1:07       ` Gabriel Dos Reis
@ 2000-06-13  9:02         ` H . J . Lu
  0 siblings, 0 replies; 31+ messages in thread
From: H . J . Lu @ 2000-06-13  9:02 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Mark Mitchell, mrs, gcc

On Tue, Jun 13, 2000 at 10:06:56AM +0200, Gabriel Dos Reis wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
> 
> | On Mon, Jun 12, 2000 at 08:01:29PM -0700, Mark Mitchell wrote:
> | > 
> | > libstdc++ V3 needs to have a mode (and it probably does!) where `long
> | > long' isn't use for compilers that don't accept it -- since they don't
> | > need to at this point.  And g++ should probably accept it with a
> | > warning, rather than issuing an error.  At least, that's my two cents;
> | > I'd like to hear Jason's opinion.
> | > 
> | 
> | -ansi defines __STRICT_ANSI__. Can we wrap the long long stuff
> | with __STRICT_ANSI__?
> 
> Please, note that it isn't -ansi that is causing the error. Using
> `long long' in C++ results in a pedwarn. Then, turning a pedwarn into
> an error is just behaviour as documented.
> 

I know that. See my subject. Could you please tell me how cpp can tell
-pedantic-errors is used? Even if cpp does, I don't know how useful
it will be.



-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  7:34       ` Mark Mitchell
  2000-06-13  8:37         ` Branko
@ 2000-06-18 10:26         ` Martin v. Loewis
  1 sibling, 0 replies; 31+ messages in thread
From: Martin v. Loewis @ 2000-06-18 10:26 UTC (permalink / raw)
  To: mark; +Cc: gdr, mrs, gcc, hjl

> 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?

Wouldn't putting __extension__ in that place turn off the error?

Regards,
Martin

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-13  8:37         ` Branko
@ 2000-06-18 10:34           ` Martin v. Loewis
  2000-06-19  2:44             ` Branko
  0 siblings, 1 reply; 31+ messages in thread
From: Martin v. Loewis @ 2000-06-18 10:34 UTC (permalink / raw)
  To: branko.cibej; +Cc: mark, gdr, mrs, gcc, hjl

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-18 10:34           ` Martin v. Loewis
@ 2000-06-19  2:44             ` Branko
  0 siblings, 0 replies; 31+ messages in thread
From: Branko @ 2000-06-19  2:44 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: mark, gdr, mrs, gcc, hjl

"Martin v. Loewis" wrote:
> 
> > 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.

Oh, I forgot about that.

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

Yes, I think you're right.

    Brane

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-17  9:37 Richard Kenner
  0 siblings, 0 replies; 31+ messages in thread
From: Richard Kenner @ 2000-06-17  9:37 UTC (permalink / raw)
  To: espie; +Cc: gcc

    If it's not part of the current standard, and if there is a controversy,
    even amongst the committee members, about whether it will be part of
    the next standard or not, then -ansi -pedantic should warn.

Even if there *isn't* a controversy, we should be implementing the language
as it's *currently* defined, not as we might guess it will be defined in
the future.  I accept that there are some very rare cases when it makes sense
to implement speculatively in cases where it's *very* clear things are about
to be changed, but I don'tsee this as being in that category.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 20:36 Mike Stump
@ 2000-06-13 11:30 ` Geoff Keating
  0 siblings, 0 replies; 31+ messages in thread
From: Geoff Keating @ 2000-06-13 11:30 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc

Mike Stump <mrs@windriver.com> writes:

> > Date: Tue, 13 Jun 2000 04:00:54 +0200
> > From: Marc Espie <espie@quatramaran.ens.fr>

> > It might be that you are on opposing branches off the committee.  I
> > don't think gcc/g++ should be a battling ground for the committee.
> > If it's not part of the current standard, and if there is a
> > controversy, even amongst the committee members, about whether it
> > will be part of the next standard or not, then -ansi -pedantic
> > should warn.
> 
> And if there is no controversy, or if the only controversy comes from
> ignorance?

Unless you have a genuine, final copy of the standard that includes a
feature, the feature is not in the standard.  It's not a matter of
opinions or debate, all you have to do is find a copy of the standard
and read it (and then, of course, debate endlessly what the standard
really means when there are parts that are unclear, but I don't think
this is one of those times).

I would suspect that including 'long long' in the library will often
cause the library to be no longer standards-conforming.  In that case
you'll want to take it out, at least when -ansi is specified.
Otherwise, I would suggest using __extension__ to suppress the error
or warning.  See for instance how glibc deals with 'long long' in its
C89-conformant mode.
-- 
- Geoffrey Keating <geoffk@cygnus.com>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 20:36 Mike Stump
  2000-06-13 11:30 ` Geoff Keating
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Stump @ 2000-06-12 20:36 UTC (permalink / raw)
  To: espie; +Cc: gcc

> Date: Tue, 13 Jun 2000 04:00:54 +0200
> From: Marc Espie <espie@quatramaran.ens.fr>

> On Mon, Jun 12, 2000 at 06:57:34PM -0700, Mike Stump wrote:
> > > After all, he's part of the committee.

> > Ditto.

> > > I know that the C++ committee had some harsh words about C99, I
> > > don't quite remember the details, but C99 did break a few
> > > compatibilities routes for C++.

> > Was he in the room when we last talked about long long support in C++?
> > I was.

> It might be that you are on opposing branches off the committee.  I
> don't think gcc/g++ should be a battling ground for the committee.
> If it's not part of the current standard, and if there is a
> controversy, even amongst the committee members, about whether it
> will be part of the next standard or not, then -ansi -pedantic
> should warn.

And if there is no controversy, or if the only controversy comes from
ignorance?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 18:57 Mike Stump
  2000-06-12 19:01 ` Marc Espie
@ 2000-06-12 19:14 ` Gabriel Dos Reis
  1 sibling, 0 replies; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-12 19:14 UTC (permalink / raw)
  To: Mike Stump; +Cc: espie, gcc

Mike Stump <mrs@windriver.com> writes:

[...]

| > I know that the C++ committee had some harsh words about C99, I
| > don't quite remember the details, but C99 did break a few
| > compatibilities routes for C++.
| 
| Was he in the room when we last talked about long long support in C++?
| I was.

I wasn't there. But our main delegate was. And at AFNOR (French
National Body), we do have strong opinions againt long long.

(If you have been tracking standards, you certainly know France
position on long long in C99)

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 18:57 Mike Stump
@ 2000-06-12 19:01 ` Marc Espie
  2000-06-12 19:14 ` Gabriel Dos Reis
  1 sibling, 0 replies; 31+ messages in thread
From: Marc Espie @ 2000-06-12 19:01 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc

On Mon, Jun 12, 2000 at 06:57:34PM -0700, Mike Stump wrote:
> > After all, he's part of the committee.

> Ditto.

> > I know that the C++ committee had some harsh words about C99, I
> > don't quite remember the details, but C99 did break a few
> > compatibilities routes for C++.

> Was he in the room when we last talked about long long support in C++?
> I was.

It might be that you are on opposing branches off the committee.
I don't think gcc/g++ should be a battling ground for the committee.
If it's not part of the current standard, and if there is a controversy,
even amongst the committee members, about whether it will be part of
the next standard or not, then -ansi -pedantic should warn.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 18:57 Mike Stump
  2000-06-12 19:01 ` Marc Espie
  2000-06-12 19:14 ` Gabriel Dos Reis
  0 siblings, 2 replies; 31+ messages in thread
From: Mike Stump @ 2000-06-12 18:57 UTC (permalink / raw)
  To: espie; +Cc: gcc

> Date: Tue, 13 Jun 2000 03:39:01 +0200
> From: Marc Espie <espie@quatramaran.ens.fr>
> To: mrs@windriver.com

> I believe that Gaby is quite used to tracking the C++ standard.

More so than I?

> If he believes that C++ might not have `long long' after the next
> revision, he might have good reason to do so.

More so than I?  I've been a member of ANSI C++ since 1992.  I doubt it.

> After all, he's part of the committee.

Ditto.

> I know that the C++ committee had some harsh words about C99, I
> don't quite remember the details, but C99 did break a few
> compatibilities routes for C++.

Was he in the room when we last talked about long long support in C++?
I was.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 17:58 Mike Stump
@ 2000-06-12 18:07 ` Gabriel Dos Reis
  0 siblings, 0 replies; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-12 18:07 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc, hjl

Mike Stump <mrs@windriver.com> writes:

| > To: Mike Stump <mrs@windriver.com>
| > From: Gabriel Dos Reis <gdr@codesourcery.com>
| > Date: 13 Jun 2000 02:42:48 +0200
| 
| > Unless I'm mistaken, ISO C++ doesn't follow ISO C on the long long
| > road.
| 
| Yes, you're mistake.  What you assume is `now' or `currently'.  I
| don't.  In my opinion, there isn't a good reason to take your
| approach.  It is only not in currently because the 5 year clock hasn't
| expired on revving the C++ Standard, when it does, then you'll see I
| was right.  I can wait.

:-)

Even in 5 years, I'm not sure C++ will incorporate long long; and I can
wait too :-)

I think -ansi -pedantic should check for the language rules as
currently defined. Or we have to rename these options (or change their
documentations).

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 17:58 Mike Stump
  2000-06-12 18:07 ` Gabriel Dos Reis
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Stump @ 2000-06-12 17:58 UTC (permalink / raw)
  To: gdr; +Cc: gcc, hjl

> To: Mike Stump <mrs@windriver.com>
> From: Gabriel Dos Reis <gdr@codesourcery.com>
> Date: 13 Jun 2000 02:42:48 +0200

> Unless I'm mistaken, ISO C++ doesn't follow ISO C on the long long
> road.

Yes, you're mistake.  What you assume is `now' or `currently'.  I
don't.  In my opinion, there isn't a good reason to take your
approach.  It is only not in currently because the 5 year clock hasn't
expired on revving the C++ Standard, when it does, then you'll see I
was right.  I can wait.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
  2000-06-12 15:53 Mike Stump
@ 2000-06-12 17:43 ` Gabriel Dos Reis
  0 siblings, 0 replies; 31+ messages in thread
From: Gabriel Dos Reis @ 2000-06-12 17:43 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc, hjl

Mike Stump <mrs@windriver.com> writes:

| > Date: Mon, 12 Jun 2000 10:23:54 -0700
| > From: "H . J . Lu" <hjl@valinux.com>
| > To: gcc@gcc.gnu.org
| > Content-Disposition: inline
| > User-Agent: Mutt/1.2i
| 
| > With my libstdc++ v3 "make check" patch, I got some many failures
| > like
| 
| > In file included from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_iostream.h:38,^M
| >                  from
| > 		 /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/backward/iostream.h:32,^M
| >                   from /work/gnu/src/gcc-3.0/egcs/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C:2:^M
| > /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_ostream.h:128: ISO C++ does not support `long long'^M 
| 
| > It is caused by -ansi -pedantic-errors and long long. What should we
| > do about it?
| 
| Remove it (the pedwarn call).  ISO C has added them.  ISO C++ follows
| ISO C, unless there is a very specific and very good reason not to.

Unless I'm mistaken, ISO C++ doesn't follow ISO C on the long long
road.

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 15:53 Mike Stump
  2000-06-12 17:43 ` Gabriel Dos Reis
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Stump @ 2000-06-12 15:53 UTC (permalink / raw)
  To: gcc, hjl

> Date: Mon, 12 Jun 2000 10:23:54 -0700
> From: "H . J . Lu" <hjl@valinux.com>
> To: gcc@gcc.gnu.org
> Content-Disposition: inline
> User-Agent: Mutt/1.2i

> With my libstdc++ v3 "make check" patch, I got some many failures
> like

> In file included from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_iostream.h:38,^M
>                  from
> 		 /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/backward/iostream.h:32,^M
>                   from /work/gnu/src/gcc-3.0/egcs/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C:2:^M
> /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_ostream.h:128: ISO C++ does not support `long long'^M 

> It is caused by -ansi -pedantic-errors and long long. What should we
> do about it?

Remove it (the pedwarn call).  ISO C has added them.  ISO C++ follows
ISO C, unless there is a very specific and very good reason not to.
In this case, there is no such reason, therefore, we know that there
is no reason to have this message anymore.  If someone wants to retain
it under an older language standard, that is fine, but it should be
harder to get at (not with the flags you gave).

^ permalink raw reply	[flat|nested] 31+ messages in thread

* long long, C++ testsuite and -ansi -pedantic-errors
@ 2000-06-12 10:23 H . J . Lu
  0 siblings, 0 replies; 31+ messages in thread
From: H . J . Lu @ 2000-06-12 10:23 UTC (permalink / raw)
  To: gcc

With my libstdc++ v3 "make check" patch, I got some many failures
like

In file included from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_iostream.h:38,^M
                 from
		 /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/backward/iostream.h:32,^M
                  from /work/gnu/src/gcc-3.0/egcs/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C:2:^M
/work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_ostream.h:128: ISO C++ does not support `long long'^M 

It is caused by -ansi -pedantic-errors and long long. What should we
do about it?


-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2000-06-19  2:44 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-12 18:31 long long, C++ testsuite and -ansi -pedantic-errors Mike Stump
2000-06-12 18:39 ` Marc Espie
2000-06-12 19:09 ` Gabriel Dos Reis
2000-06-12 20:01   ` Mark Mitchell
2000-06-12 20:39     ` H . J . Lu
2000-06-12 21:25       ` Steven King
2000-06-12 21:44         ` H . J . Lu
2000-06-12 22:04           ` Steven King
2000-06-12 23:04             ` H . J . Lu
2000-06-13  0:39           ` Gabriel Dos Reis
2000-06-13  8:49             ` H . J . Lu
2000-06-13  9:00               ` Gabriel Dos Reis
2000-06-13  1:07       ` Gabriel Dos Reis
2000-06-13  9:02         ` H . J . Lu
2000-06-13  1:01     ` Gabriel Dos Reis
2000-06-13  7:34       ` Mark Mitchell
2000-06-13  8:37         ` Branko
2000-06-18 10:34           ` Martin v. Loewis
2000-06-19  2:44             ` Branko
2000-06-18 10:26         ` Martin v. Loewis
  -- strict thread matches above, loose matches on Subject: below --
2000-06-17  9:37 Richard Kenner
2000-06-12 20:36 Mike Stump
2000-06-13 11:30 ` Geoff Keating
2000-06-12 18:57 Mike Stump
2000-06-12 19:01 ` Marc Espie
2000-06-12 19:14 ` Gabriel Dos Reis
2000-06-12 17:58 Mike Stump
2000-06-12 18:07 ` Gabriel Dos Reis
2000-06-12 15:53 Mike Stump
2000-06-12 17:43 ` Gabriel Dos Reis
2000-06-12 10:23 H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).