incubator-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] Created: (STDCXX-358) [gcc/Mac OS X 10.4.8 Tiger] The unsetenv() function may be defined without a return value.
Date Wed, 14 Mar 2007 16:35:09 GMT
[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
         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


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