You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Eric Lemings (JIRA)" <ji...@apache.org> on 2007/03/14 17:37:09 UTC

[jira] Updated: (STDCXX-358) [gcc/Mac OS X 10.4.8 Tiger] The unsetenv() function may be defined without a return value.

     [ https://issues.apache.org/jira/browse/STDCXX-358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Lemings updated STDCXX-358:
--------------------------------

          Component/s: Build
        Fix Version/s: 4.2
    Affects Version/s: 4.1.3
                       4.1.2

Forgot to specify component and versions.

> [gcc/Mac OS X 10.4.8 Tiger] The unsetenv() function may be defined without a return value.
> ------------------------------------------------------------------------------------------
>
>                 Key: STDCXX-358
>                 URL: https://issues.apache.org/jira/browse/STDCXX-358
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 4.1.3, 4.1.2
>         Environment: Darwin host.local 8.8.1 Darwin Kernel Version 8.8.1: Mon Sep 25 19:42:00 PDT 2006; root:xnu-792.13.8.obj~1/RELEASE_I386 i386 i386
>            Reporter: Eric Lemings
>             Fix For: 4.2
>
>
> On Mac OS X/Darwin platforms, the unsetenv() function may be defined without a return value depending on the value of the __DARWIN_UNIX03 macro.  Here's the declaration of unsetenv() from /usr/include/stdlib.h:
>     240 #if __DARWIN_UNIX03
>     241 int      unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
>     242 #else /* !__DARWIN_UNIX03 */
>     243 void     unsetenv(const char *);
>     244 #endif /* __DARWIN_UNIX03 */
> The __DARWIN_UNIX03 macro is defined in the /usr/include/sys/cdefs.h header file.  It may be defined as 1 or 0.  This causes compilation of the tests/src/environ.cpp source file to fail.  Here's a patch for it.
> Index: tests/src/environ.cpp
> ===================================================================
> --- tests/src/environ.cpp       (revision 517771)
> +++ tests/src/environ.cpp       (working copy)
> @@ -134,7 +134,10 @@
>              // try to remove variable from the environment
>  
>  #ifndef _RWSTD_NO_UNSETENV
> -            ret = unsetenv (envvar);
> +#  if  !defined __DARWIN_UNIX03 || __DARWIN_UNIX03
> +            ret = 
> +#  endif
> +            unsetenv (envvar);
>  #else
>              ret = putenv (envvar);
>  #endif

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.