Article View: gnu.gcc.bug
Article #1834Bug in gcc 1.26: ansi prototypes
From: Tatu Yl|nen
Date: Thu, 20 Oct 1988 11:54
Date: Thu, 20 Oct 1988 11:54
33 lines
1781 bytes
1781 bytes
/*
Bug in Gnu C compiler version 1.26: type checking in prototypes
Compiling the following code with gcc version 1.26 gives incorrect error
messages. Type checking in prototypes is not done correctly. It looks
like gcc converts the type given in the prototype to int (or whatever
the argument type is usually converted to in function arguments).
This converted type is then compared against the actual function
arguments in the function definition. The error is reported in the
function definition. The fix must prevent converting argument types
in prototypes.
The program generates the error when compiled with the command
gcc -c foo.c
The computer is a 386-based AT with 10MB of ram and a 350MB scsi disk.
It is running Microport System V/386 (System V release 3.0).
Tatu Yl|nen ylo@hupu.hut.fi ..!mcvax!santra!hupu!ylo
*/
/*---------------------- cut here --------------------------*/
int a(char x); /* gives an error - this is wrong */
/* int a(char); /* gives an error - this is wrong */
/* int a(int); /* gives no error - this is wrong */
/* int a(); /* gives no error - this is correct */
int a(x) char x;
{
return x == 'b';
}
/*----------------------- cut here -------------------------*/
Technical Details
Message-ID:
<8810200955.AA15008@puukko.hut.fi>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!t35124p%puukko.hut.fiShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!t35124p%puukko.hut.fi From: t35124p%puukko.hut.fi@MITVMA.MIT.EDU (Tatu Yl|nen) Newsgroups: gnu.gcc.bug Subject: Bug in gcc 1.26: ansi prototypes Message-ID: <8810200955.AA15008@puukko.hut.fi> Date: 20 Oct 88 11:54:57 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32