Article View: gnu.gcc.bug
Article #2298gcc bug?
From: Bill Duttweiler
Date: Mon, 13 Feb 1989 16:57
Date: Mon, 13 Feb 1989 16:57
42 lines
1870 bytes
1870 bytes
Here is what I believe to be a bug in 'gcc':
---File that may be compiled to exhibit the problem:
----cut here-----
typedef struct none_of_my_business *Widget;
extern void i_need_a_widget(Widget);
void
why_does_this_work(Widget W)
{
i_need_a_widget(W);
}
void
why_doesnt_this_work(W)
Widget W;
{
i_need_a_widget(W);
}
---cut here ---
---Command executed was 'gcc -v -c gcc-bug.c'. here is the output:
gcc version 1.32
/uhe2/src/gcc-sun4/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -DUNIX -D__sparc__ -D__sun__ -D__unix__ -D__UNIX__ gcc-bug.c /tmp/cca01334.cpp
GNU CPP version 1.32
/uhe2/src/gcc-sun4/lib/gcc-cc1 /tmp/cca01334.cpp -quiet -dumpbase gcc-bug.c -version -o /tmp/cca01334.s
GNU C version 1.32 (sparc) compiled by GNU C version 1.32.
gcc-bug.c:3: warning: parameter points to incomplete type
gcc-bug.c:7: warning: parameter `W' points to incomplete type
gcc-bug.c: In function why_doesnt_this_work:
gcc-bug.c:15: incompatible types in argument passing
---The machine I'm using is a SUN4/150, running SunOs4.0.1. tm.h is tm-sparc.h
and md is sparc.md.
--I believe SOMETHING is wrong in handling the opaque pointer. The function
that declares 'W' in the parameter list doesn't get an error in calling
'i_need_a_widget()', while the other one does. The warnings about incomplete
types are also a nusiance...the X Window stuff uses a bunch of opaque handles
on things, which, of course, is how I encountered this in the first place.
Technical Details
Message-ID:
<8902131657.AA01343@sake.SWS-ASC.SLB.COM>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!ascway!wkdShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!ascway!wkd From: ascway!wkd@CS.UTEXAS.EDU (Bill Duttweiler) Newsgroups: gnu.gcc.bug Subject: gcc bug? Message-ID: <8902131657.AA01343@sake.SWS-ASC.SLB.COM> Date: 13 Feb 89 16:57:13 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 42