[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Re: groff 1.19.1 compilation with xlC och AIX
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] Re: groff 1.19.1 compilation with xlC och AIX |
Date: |
Thu, 27 May 2004 08:41:29 +0200 (CEST) |
[I took the liberty to CC your mail to the groff list.]
> > Hmm. I've removed them because I got warnings from the GNU C++
> > compiler. For both g++ 3.0.1 and 2.95.3, a `friend' declaration
> > is sufficient. Code like this:
> >
> > void end_diversions();
> >
> > class diversion {
> > friend void do_divert(int append, int boxing);
> > friend void end_diversions();
> >
> > produces a warning about declaring `end_diversions' twice. Is
> > somebody on the list who knows the C++ standard well enough to decide
> > whether this is a feature of g++ or whether this really conforms to
> > ANSI C++?
>
> I don't know the 'friends' part well enough and I'm too lazy to
> check, but for what it's worth I see no problems in 2.95.4 (with
> Debian patches I suppose) and 3.4.0 (vanilla gcc):
>
> | frailea:/tmp> gcc --version
> | 2.95.4
> | frailea:/tmp> /opt/gcc-3.4/bin/g++ --version
> | g++ (GCC) 3.4.0
> | Copyright (C) 2004 Free Software Foundation, Inc.
> | This is free software; see the source for copying conditions. There is NO
> | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> |
> | frailea:/tmp> cat foo.cc
> | void end_diversions();
> |
> | class diversion {
> | friend void do_divert(int append, int boxing);
> | friend void end_diversions();
> | };
> | frailea:/tmp> /opt/gcc-3.4/bin/g++ -Wall -ansi -pedantic -c foo.cc
> | frailea:/tmp> g++ -Wall -ansi -pedantic -c foo.cc
> | frailea:/tmp>
Thanks for testing. Just curious: If you omit the first prototype, do
you get a warning? What about -Wstrict-prototypes?
BTW, I no longer can reproduce the warnings on my platform, so I'll
apply the sent patches.
Anyway, there is still the question whether gcc's behaviour is
compliant with ANSI C++... Whom could I ask?
Werner