This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: typedef - bug?
- To: matuszew at informatik dot uni-halle dot de
- Subject: Re: typedef - bug?
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 9 Oct 1999 12:53:43 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <37EF521B.4FD17A13@helios.informatik.uni-halle.de>
> while compiling the following code with g++ error.cc
>
> typedef struct {
> // ...
> }*str;
>
> void proto (str struct_ptr);
>
> int main (void)
> {
> return 0;
> }
>
> i get the following message:
> error.cc:5: non-local function `void proto({anonymous struct} *)' uses
> anonymous type
This is an error in your code (which was not reported by earlier
versions). The type you define is an anonymous type (i.e. with no
linkage). You must not use such a type as a parameter to a function
with external linkage.
Hope this helps,
Martin