Sun 13 Jun 2010 05:48:48 PM UTC, comment #1:
It's not clear to me where the error comes from. OSF/1 5.1
systems do declare the unsetenv() function, but they do so
with return type 'void' instead of 'int'.
You should see the following:
$ grep UNSETENV config.status
S["REPLACE_UNSETENV"]="1"
S["HAVE_UNSETENV"]="1"
S["GNULIB_UNSETENV"]="IN_LIBUNISTRING_GNULIB_TESTS"
D["HAVE_RAW_DECL_UNSETENV"]=" 1"
D["HAVE_UNSETENV"]=" 1"
D["VOID_UNSETENV"]=" 1"
D["GNULIB_TEST_UNSETENV"]=" 1"
The section dealing with unsetenv in lib/stdlib.h should look
like this:
#if IN_LIBUNISTRING_GNULIB_TESTS
/* Remove the variable NAME from the environment. */
# if 1
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
# if !1
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif
_GL_CXXALIASWARN (unsetenv);
...
Therefore it is unclear to me how you can get an error message
"test-unsetenv.c:24: error: 'unsetenv' undeclared here (not in a function)"
Btw, this error message comes from a gcc. Can you
1) show the result of gcc --version?
2) try to compile with CC=cc, assuming you have a cc compiler
installed?
|