Article View: gnu.gcc.bug
Article #2252bug in const structures?
From: Paul Hudson
Date: Mon, 06 Feb 1989 12:25
Date: Mon, 06 Feb 1989 12:25
33 lines
1041 bytes
1041 bytes
I believe (from my reading of an old ANSI draft) that the following is
legal.
typedef struct s { float x, y; } U;
static const U b[5];
void f(const U s);
main()
{
f(b[1]);
}
but gcc1.32 gives incompatible types in arg. passing. This program
typedef struct s { float x, y; } U;
static const U b;
void f(const U s);
main()
{
f(b);
}
compiles OK. What's going on? is it a bug?
Paul Hudson
Snail mail: Monotype ADG Email: ...!ukc!acorn!moncam!paul
Science Park, paul@moncam.co.uk
Milton Road, "Sun Microsysytems:
Cambridge, The Company is Arrogant (TM)"
CB4 4FQ
Technical Details
Message-ID:
<8902061225.AA11394@marvin.moncam.uucp>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!moncam!paulShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!moncam!paul From: mcvax!moncam!paul@UUNET.UU.NET (Paul Hudson) Newsgroups: gnu.gcc.bug Subject: bug in const structures? Message-ID: <8902061225.AA11394@marvin.moncam.uucp> Date: 6 Feb 89 12:25:33 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33