Article View: comp.std.c
Article #6011Re: Is this a bug in the standard?
From: Norman Diamond
Date: Mon, 08 May 1989 01:08
Date: Mon, 08 May 1989 01:08
37 lines
1509 bytes
1509 bytes
I just wrote:
>But if you're content to wrap it in a struct, you get type-safety:
>
>union bar_t;
>
>typedef int foo_t (union bar_t); /* gets a warning from gcc 1.32 */
Correction, gets an _error_ from gcc 1.32. You have to pass a pointer
to the struct.
typedef union bar_t *bar_ptr_t;
typedef int foo_t (bar_ptr_t); /* gets a warning from gcc 1.32 */
>typedef foo_t *foo_ptr_t;
>
>typedef union bar_t {
> foo_ptr_t foo_ptr;
>} bar_t;
>
>foo_t foo; /* your prototype is done, sir */
>
>bar_t make_bar (foo_ptr_t a_foo_ptr)
Uh, make_bar_ptr ....
>{
> bar_t my_bar;
Uh, ummm, hmmmmm......
--
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.co.jp@relay.cs.net)
The above opinions are my own. | Why are programmers criticized for
If they're also your opinions, | re-inventing the wheel, when car
you're infringing my copyright. | manufacturers are praised for it?
Technical Details
Message-ID:
<10223@socslgw.csl.sony.JUNET>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamondReferences:
<189@riunite.ACA.MCC.COM> <10222@socslgw.csl.sony.JUNET>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamond From: diamond@diamond.csl.sony.junet (Norman Diamond) Newsgroups: comp.std.c Subject: Re: Is this a bug in the standard? Message-ID: <10223@socslgw.csl.sony.JUNET> Date: 8 May 89 01:08:06 GMT References: <189@riunite.ACA.MCC.COM> <10222@socslgw.csl.sony.JUNET> Sender: news@csl.sony.JUNET Reply-To: diamond@csl.sony.junet (Norman Diamond) Organization: /usr/lib/news/organization Lines: 37