This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi!
http://www.opengroup.org/onlinepubs/009695399/functions/setenv.html
http://www.opengroup.org/onlinepubs/009695399/functions/unsetenv.html
define what happens if these functions are called with NULL as
first argument (return -1 and set errno to EINVAL), therefore it is not
undefined behaviour and we shouldn't be using nonnull attribute there.
As long as that attribute is just a warning, this is not a big
trouble, but as soon as the compiler will start taking advantage
of that attribute in optimization, conforming programs could be
miscompiled.
2004-11-26 Jakub Jelinek <jakub@redhat.com>
* stdlib/stdlib.h (setenv): Use nonnull only for second argument.
(unsetenv): Remove.
--- libc/stdlib/stdlib.h.jj 2004-09-30 00:50:07.000000000 +0200
+++ libc/stdlib/stdlib.h 2004-11-26 00:54:04.391581060 +0100
@@ -669,10 +669,10 @@ extern int putenv (char *__string) __THR
/* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */
extern int setenv (__const char *__name, __const char *__value, int __replace)
- __THROW __nonnull ((1, 2));
+ __THROW __nonnull ((2));
/* Remove the variable NAME from the environment. */
-extern int unsetenv (__const char *__name) __THROW __nonnull ((1));
+extern int unsetenv (__const char *__name) __THROW;
#endif
#ifdef __USE_MISC
Jakub
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |