[PLUG] A "C" error

Anthony Schlemmer aschlemm at attbi.com
Sun Dec 29 10:47:03 UTC 2002


The other thing you can try is to rewrite the the statements like so and 
see if it makes any difference: 

#ifndef __adb
        #define __adb
        struct pADB {int unused;};
        typedef struct pADB ADB;
#endif

As far as I know there is nothing wrong with declaring both the struct 
and typedef in the same statement and you can probably find examples of 
this in the various C header files that exist on most Linux systems. 
The above statements compile under GCC 3.2 with no errors. 

Tony

On Wednesday 25 December 2002 17:07 pm, Rich Shepard wrote:
>   Mail's not posting to plug-devel so I'll ask this here.
>
>   In a header file I have this:
>
>    #ifndef __adb
>       #define __adb
>     typedef struct pADB {int unused;} ADB;	// line 610
>    #endif
>
> and gcc generates this error:
>
> fsmsystem.h:610: two or more data types in declaration of DB'
> fsmsystem.h:610: two or more data types in declaration of DB'
> fsmsystem.h:610: two or more data types in declaration of DB'
> fsmsystem.h:610: two or more data types in declaration of DB'
>
>   I've tried compiling without the 'typedef' but it makes no
> difference. I cannot see the two data types in this declaration. I
> see a struct that contains only a single int.
>
>   Will someone please show me what I cannot see?
>
> Thanks,
>
> Rich
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug

-- 
Anthony Schlemmer
aschlemm at attbi.com





More information about the PLUG mailing list