🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5955

Re: Multiple typedefs

#5955
From: Doug Gwyn
Date: Sat, 29 Apr 1989 03:02
13 lines
893 bytes
In article <2322@lethe.UUCP> drew@lethe.UUCP (Drew Sullivan) writes:
>typedef unsigned int foo_t;		/* from include file 1 */
>extern foo_t foo(void);
>typedef unsigned int foo_t;		/* from include file 2 */
>extern foo_t foo(void);

No, the second typedef is syntactically invalid.
The conventional way to guard against this is:
	#ifndef _FOO_T_DEFINED
	#define	_FOO_T_DEFINED
	typedef unsigned int foo_t;
	#endif
Sorry about that..
Technical Details
Message-ID: <10167@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!aplcen!haven!adm!smoke!gwyn
References: <2322@lethe.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Multiple typedefs
Keywords: typedefs, includes
Message-ID: <10167@smoke.BRL.MIL>
Date: 29 Apr 89 03:02:00 GMT
References: <2322@lethe.UUCP>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 13