Article View: gnu.gcc.bug
Article #1255gcc 2.2.2 compiler bug?
From: Dave Cohrs
Date: Mon, 05 Oct 1992 18:08
Date: Mon, 05 Oct 1992 18:08
35 lines
1459 bytes
1459 bytes
I believe I have found a syntax checking bug in gcc 2.2.2.
That is, if my understanding about prototypes is right...
This bug is an ANSI-ism and appears to be the converse of the "char
prototype" point that you make in the Bugs section of gcc.info.
My understanding is that if you declare a function in the "old" style,
but also specify prototypes, you must widen the parameter declarations
in the prototypes to "int" from char or short.
However, gcc -Wall, says the following prototype doesn't match the
declaration in the following program:
---- start
typedef unsigned short Dimension;
int foo(unsigned int);
int foo(x)
Dimension x;
{
return x + 1;
}
---- end
If I remove the word "unsigned" from the foo prototype, gcc compiles
this program happily, however, my understanding is that "unsigned"
can't just widen to a signed type.
Just to be specific, here's the output of gcc -v:
Reading specs from /usr/local/lib/gcc/mips-dec-ultrix4.2/2.2.2/specs
gcc version 2.2.2
dave cohrs
Technical Details
Message-ID:
<9210051808.AA25840@thumper.bellcore.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!thumper.bellcore.com!cohrsShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!thumper.bellcore.com!cohrs From: cohrs@thumper.bellcore.com (Dave Cohrs) Subject: gcc 2.2.2 compiler bug? Message-ID: <9210051808.AA25840@thumper.bellcore.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 5 Oct 1992 18:08:47 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 36