This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: several more bugs found by coreutils


On Wed, Feb 02, 2005 at 07:30:43PM +0100, Corinna Vinschen wrote:
>On Feb  2 13:13, Christopher Faylor wrote:
>> On Wed, Feb 02, 2005 at 06:49:42PM +0100, Corinna Vinschen wrote:
>> >On Feb  2 12:20, Christopher Faylor wrote:
>> >> On Wed, Feb 02, 2005 at 03:20:01PM +0100, Corinna Vinschen wrote:
>> >> >  #if defined (__CYGWIN__) && !defined (__CYGWIN_USE_BIG_TYPES__)
>> >> >  #define __pw_uid_t int
>> >> >  #endif
>> >> >  #ifndef __pw_uid_t
>> >> >  #define __pw_uid_t uid_t;
>> >> >  #endif
>> >> >
>> >> >  struct passwd {
>> >> >    char *pw_name;
>> >> >    char *pw_passwd;
>> >> >    __pw_uid_t pw_uid;
>> >> >    __pw_gid_t pw_gid;
>> >> >    [etc].
>> >> >
>> >> >Would that be ok, Jeff?
>> >> 
>> >> Why not just make __pw_uid_t a typedef?
>> >
>> >Defined where?
>> 
>> In pwd.h:
>> 
>>   #ifndef __CYGWIN__ || !defined(__CYGWIN_USE_BIG_TYPES__)
>>   typedef int __pw_uid_t;
>>   #else
>>   typedef uid_t __pw_uid_t;
>>   endif
>
>Fine with me.  I don't see a difference, though.  What's the advantage
>of having another type?

It's a preference.  I don't like using defines for types. OTOH, you could
use a #undef after #define'ing the __pwd_uid_t and then there would be
no subsequent namespace bloat.

So, actually, nevermind.  I think I'd prefer a #define followed by a #undef
for that reason.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]