stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-358) [gcc/Mac OS X 10.4.8 Tiger] The unsetenv() function may be defined without a return value.
Date Fri, 18 May 2007 22:43:16 GMT

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

Eric Lemings commented on STDCXX-358:
-------------------------------------

There is an easier patch for this issue.

$ diff -c tests/src/environ.cpp.0 tests/src/environ.cpp
*** tests/src/environ.cpp.0     Fri May 18 10:53:45 2007
--- tests/src/environ.cpp       Fri May 18 16:29:50 2007
***************
*** 134,140 ****
              // try to remove variable from the environment
  
  #ifndef _RWSTD_NO_UNSETENV
! #  ifdef _RWSTD_OS_FREEBSD
              // FreeBSD declares void unsetenv(const char*)
              // http://www.freebsd.org/cgi/man.cgi?query=unsetenv&sektion=3
              unsetenv (envvar);
--- 134,140 ----
              // try to remove variable from the environment
  
  #ifndef _RWSTD_NO_UNSETENV
! #  if defined _RWSTD_OS_FREEBSD || defined _RWSTD_OS_DARWIN
              // FreeBSD declares void unsetenv(const char*)
              // http://www.freebsd.org/cgi/man.cgi?query=unsetenv&sektion=3
              unsetenv (envvar);

Also this is the last issue for porting STDCXX to Mac OS X platforms.  Once resolved (along
with issue 357), STDCXX builds and runs fine on Mac OS X.  It does however require GCC 4.2
or later version.  It will not build with the system GCC compiler (4.0.1).


> [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.


Mime
View raw message