Article View: gnu.gcc.help
Article #52665prototypes with short args generate fatal error
From: Andy Burgess
Date: Mon, 08 Jun 1992 17:49
Date: Mon, 08 Jun 1992 17:49
24 lines
1476 bytes
1476 bytes
The following code does not compile using gcc 2.1 on SunOS 4.1.1.
Is the C code indeed illegal and if so what would the justification be?
I ran into this while trying to compile xmon in the X11R5 distribution.
Using cc (SC1.0 1Mar1991) it compiles without error.
----------------------
int foo(short x);
int bar(short x);
int foo(short x) {} /* this works */
int bar(x) short x; {} /* this does not */
---------------------
gcc bug.c
bug.c: In function `bar':
bug.c:6: argument `x' doesn't match function prototype
bug.c:6: a formal parameter type that promotes to `int'
bug.c:6: can match only `int' in the prototype
--
==================================================================================
Andrew A. Burgess aab@cichlid.com voice (408) 335 4779
==================================================================================
Technical Details
Message-ID:
<1992Jun8.174919.25532@cichlid.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!csus.edu!netcomsv!cichlid!aabShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,b21c3ee4f807878a,start X-Google-Attributes: gid11318c,public X-Google-Thread: 1014db,b21c3ee4f807878a,start X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 1992-06-08 06:54:02 PST Newsgroups: gnu.gcc.help,comp.lang.c Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!csus.edu!netcomsv!cichlid!aab From: aab@cichlid.com (Andy Burgess) Subject: prototypes with short args generate fatal error Message-ID: <1992Jun8.174919.25532@cichlid.com> Organization: SIlma Inc. Date: Mon, 8 Jun 1992 17:49:19 GMT Lines: 24