* Re: Different behaviour of gcc and g++ (egcs-1.1.1 release)
@ 1999-03-03 13:59 Mike Stump
[not found] ` < 199903032159.NAA19216@kankakee.wrs.com >
1999-03-31 23:46 ` Mike Stump
0 siblings, 2 replies; 6+ messages in thread
From: Mike Stump @ 1999-03-03 13:59 UTC (permalink / raw)
To: carlo, egcs-bugs; +Cc: egcs
> From: Carlo Wood <carlo@runaway.xs4all.nl>
> Date: Wed, 3 Mar 1999 14:38:38 +0100 (CET)
> the following very simple C program does compile as C++ program,
> but the C compiler refuses to compile it. Is this a bug?
Yes, GNU C should be forward compatible with future ISO C standards
and in a future ISO C standard they will fix this. The the ISO C++
Standard for the fixed semantics.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Different behaviour of gcc and g++ (egcs-1.1.1 release)
[not found] ` < 199903032159.NAA19216@kankakee.wrs.com >
@ 1999-03-03 14:16 ` Joe Buck
1999-03-31 23:46 ` Joe Buck
0 siblings, 1 reply; 6+ messages in thread
From: Joe Buck @ 1999-03-03 14:16 UTC (permalink / raw)
To: Mike Stump; +Cc: carlo, egcs-bugs, egcs
> > From: Carlo Wood <carlo@runaway.xs4all.nl>
> > Date: Wed, 3 Mar 1999 14:38:38 +0100 (CET)
>
> > the following very simple C program does compile as C++ program,
> > but the C compiler refuses to compile it. Is this a bug?
>
> Yes, GNU C should be forward compatible with future ISO C standards
> and in a future ISO C standard they will fix this. The the ISO C++
> Standard for the fixed semantics.
You could make a good argument that GNU C should accept the example
(with warnings for -ansi or -pedantic). This is basically a mistake
in the C standard that was corrected in the C++ standard (and will
almost certainly be fixed in C9X).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Different behaviour of gcc and g++ (egcs-1.1.1 release)
1999-03-03 13:59 Different behaviour of gcc and g++ (egcs-1.1.1 release) Mike Stump
[not found] ` < 199903032159.NAA19216@kankakee.wrs.com >
@ 1999-03-31 23:46 ` Mike Stump
1 sibling, 0 replies; 6+ messages in thread
From: Mike Stump @ 1999-03-31 23:46 UTC (permalink / raw)
To: carlo, egcs-bugs; +Cc: egcs
> From: Carlo Wood <carlo@runaway.xs4all.nl>
> Date: Wed, 3 Mar 1999 14:38:38 +0100 (CET)
> the following very simple C program does compile as C++ program,
> but the C compiler refuses to compile it. Is this a bug?
Yes, GNU C should be forward compatible with future ISO C standards
and in a future ISO C standard they will fix this. The the ISO C++
Standard for the fixed semantics.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Different behaviour of gcc and g++ (egcs-1.1.1 release)
1999-03-03 14:16 ` Joe Buck
@ 1999-03-31 23:46 ` Joe Buck
0 siblings, 0 replies; 6+ messages in thread
From: Joe Buck @ 1999-03-31 23:46 UTC (permalink / raw)
To: Mike Stump; +Cc: carlo, egcs-bugs, egcs
> > From: Carlo Wood <carlo@runaway.xs4all.nl>
> > Date: Wed, 3 Mar 1999 14:38:38 +0100 (CET)
>
> > the following very simple C program does compile as C++ program,
> > but the C compiler refuses to compile it. Is this a bug?
>
> Yes, GNU C should be forward compatible with future ISO C standards
> and in a future ISO C standard they will fix this. The the ISO C++
> Standard for the fixed semantics.
You could make a good argument that GNU C should accept the example
(with warnings for -ansi or -pedantic). This is basically a mistake
in the C standard that was corrected in the C++ standard (and will
almost certainly be fixed in C9X).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Different behaviour of gcc and g++ (egcs-1.1.1 release)
1999-03-03 7:42 Carlo Wood
@ 1999-03-31 23:46 ` Carlo Wood
0 siblings, 0 replies; 6+ messages in thread
From: Carlo Wood @ 1999-03-31 23:46 UTC (permalink / raw)
To: egcs-bugs; +Cc: egcs
Hiya,
the following very simple C program does compile as C++ program,
but the C compiler refuses to compile it. Is this a bug?
-----------------------------------------------------------------------------
void foo(char const * const * t) { }
int main(void)
{
char *tok[10];
foo(tok);
return 0;
}
-----------------------------------------------------------------------------
Compiled as C++:
~/c/tests>g++ -Wall -pedantic const.cc
~/c/tests>
Compiles as C:
~/c/tests>gcc const.c
const.c: In function `main':
const.c:6: warning: passing arg 1 of `foo' from incompatible pointer type
I believe this warning to be wrong.
Regards,
--
Carlo Wood <carlo@runaway.xs4all.nl>
==========
PS I use egcs-1.1.1 release.
binutils-2.9.1.0.15-1
~/c/tests>gcc -v -Wall -pedantic const.c
Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/sp
ecs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/cpp -lang-c -v -unde
f -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D
__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux
-Asystem(posix) -Wall -pedantic -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di3
86 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D
__pentiumpro__ const.c /tmp/ccSqROlP.i
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/egcs/i686-pc-linux-gnu/include
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/include
/usr/include
End of search list.
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/cc1 /tmp/ccSqROlP.i
-quiet -dumpbase const.c -Wall -pedantic -version -o /tmp/ccWcxDVA.s
GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i686-pc-linux-gnu) com
piled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
const.c: In function `main':
const.c:6: warning: passing arg 1 of `foo' from incompatible pointer type
as -V -Qy -o /tmp/ccCQg9cq.o /tmp/ccWcxDVA.s
GNU assembler version 2.9.1 (i686-pc-linux-gnu), using BFD version 2.9.1.0.15
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/e
gcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/crtbegin.o -L/usr/local/egcs/lib/
gcc-lib/i686-pc-linux-gnu/egcs-2.91.60 -L/usr/local/egcs/i686-pc-linux-gnu/lib -
L/usr/local/egcs/lib /tmp/ccCQg9cq.o -lgcc -lc -lgcc /usr/local/egcs/lib/gcc-lib
/i686-pc-linux-gnu/egcs-2.91.60/crtend.o /usr/lib/crtn.o
^ permalink raw reply [flat|nested] 6+ messages in thread
* Different behaviour of gcc and g++ (egcs-1.1.1 release)
@ 1999-03-03 7:42 Carlo Wood
1999-03-31 23:46 ` Carlo Wood
0 siblings, 1 reply; 6+ messages in thread
From: Carlo Wood @ 1999-03-03 7:42 UTC (permalink / raw)
To: egcs-bugs; +Cc: egcs
Hiya,
the following very simple C program does compile as C++ program,
but the C compiler refuses to compile it. Is this a bug?
-----------------------------------------------------------------------------
void foo(char const * const * t) { }
int main(void)
{
char *tok[10];
foo(tok);
return 0;
}
-----------------------------------------------------------------------------
Compiled as C++:
~/c/tests>g++ -Wall -pedantic const.cc
~/c/tests>
Compiles as C:
~/c/tests>gcc const.c
const.c: In function `main':
const.c:6: warning: passing arg 1 of `foo' from incompatible pointer type
I believe this warning to be wrong.
Regards,
--
Carlo Wood <carlo@runaway.xs4all.nl>
==========
PS I use egcs-1.1.1 release.
binutils-2.9.1.0.15-1
~/c/tests>gcc -v -Wall -pedantic const.c
Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/sp
ecs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/cpp -lang-c -v -unde
f -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D
__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux
-Asystem(posix) -Wall -pedantic -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di3
86 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D
__pentiumpro__ const.c /tmp/ccSqROlP.i
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/egcs/i686-pc-linux-gnu/include
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/include
/usr/include
End of search list.
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/cc1 /tmp/ccSqROlP.i
-quiet -dumpbase const.c -Wall -pedantic -version -o /tmp/ccWcxDVA.s
GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i686-pc-linux-gnu) com
piled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
const.c: In function `main':
const.c:6: warning: passing arg 1 of `foo' from incompatible pointer type
as -V -Qy -o /tmp/ccCQg9cq.o /tmp/ccWcxDVA.s
GNU assembler version 2.9.1 (i686-pc-linux-gnu), using BFD version 2.9.1.0.15
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/e
gcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/crtbegin.o -L/usr/local/egcs/lib/
gcc-lib/i686-pc-linux-gnu/egcs-2.91.60 -L/usr/local/egcs/i686-pc-linux-gnu/lib -
L/usr/local/egcs/lib /tmp/ccCQg9cq.o -lgcc -lc -lgcc /usr/local/egcs/lib/gcc-lib
/i686-pc-linux-gnu/egcs-2.91.60/crtend.o /usr/lib/crtn.o
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1999-03-31 23:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-03 13:59 Different behaviour of gcc and g++ (egcs-1.1.1 release) Mike Stump
[not found] ` < 199903032159.NAA19216@kankakee.wrs.com >
1999-03-03 14:16 ` Joe Buck
1999-03-31 23:46 ` Joe Buck
1999-03-31 23:46 ` Mike Stump
-- strict thread matches above, loose matches on Subject: below --
1999-03-03 7:42 Carlo Wood
1999-03-31 23:46 ` Carlo Wood
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).