Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Dave Cohrs
Mon, 05 Oct 1992 18:08
gcc 2.2.2 compiler bug?
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads