Article View: comp.std.c
Article #5941Multiple typedefs
From: Drew Sullivan
Date: Tue, 25 Apr 1989 18:46
Date: Tue, 25 Apr 1989 18:46
24 lines
1130 bytes
1130 bytes
Under ANSI-C the I think that the following is legal: +------------------------------------------------------------ | #define foo_t unsigned int /* from include file 1 */ | extern foo_t foo(void); | | #define foo_t unsigned int /* from include file 2 */ | extern foo_t foo(void); +------------------------------------------------------------ But, is the following legal: +------------------------------------------------------------ | 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); +------------------------------------------------------------ If it is not legal how do we guard the multiple typedefs. Do we use #ifdefs, and if so, are there to be any conventions. -- -- Drew Sullivan, <drew@lethe.uucp>
Technical Details
Message-ID:
<2322@lethe.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!dptcdc!lethe!drewShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!dptcdc!lethe!drew From: drew@lethe.UUCP (Drew Sullivan) Newsgroups: comp.std.c Subject: Multiple typedefs Keywords: typedefs, includes Message-ID: <2322@lethe.UUCP> Date: 25 Apr 89 18:46:50 GMT Organization: Systems Software Lines: 24