bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] getdate.y problem - 'void unsetenv(); ' vs 'int unseten


From: Bruno Haible
Subject: Re: [Bug-gnulib] getdate.y problem - 'void unsetenv(); ' vs 'int unsetenv(); '
Date: Tue, 2 Nov 2004 13:23:03 +0100
User-agent: KMail/1.5

Mark D. Baushke wrote:
> On NetBSD, and FreeBSD and Redhat 7.3 GNU/Linux,
>
> The unsetenv() function is a void function:
>
> % grep unsetenv /usr/include/*.h
> /usr/include/stdlib.h:void       unsetenv __P((const char *));
> % uname -a
> NetBSD ran 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004   
> 
> address@hidden:/autobuild/netbsd-1-6-PATCH002/i386/OBJ/autobuild/
>netbsd-1-6-PATCH002/src/sys/arch/i386/compile/GENERIC i386 %
>
> So, getdate.y line 1360 has problems:
>     ok &= (tz0 ? setenv ("TZ", tz0, 1) : unsetenv ("TZ")) == 0;
>
> I suggest it is desirable to change getdate.y
>
>     ok &= (tz0 ? setenv ("TZ", tz0, 1) : unsetenv ("TZ"),0) == 0;

getdate.y is correct: POSIX specifies a return type of 'int' for
unsetenv().

I've changed the gnulib setenv module to provide a wrapper macro for
unsetenv(), if the system declares it as void. Does this work for you?

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]