bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: status of new 'c++defs' module?


From: John W. Eaton
Subject: Re: status of new 'c++defs' module?
Date: Tue, 16 Mar 2010 09:59:38 -0400

On 13-Mar-2010, Bruno Haible wrote:

| Good point. I'm adding this as an extra check in the testsuite:

Thanks for the additional changes.  I modified the Octave sources so
that GNULIB_NAMESPACE is defined to gnulib and tagged all the uses
that were reported by GCC warnings.  Everything worked fine on my
Debian system.  Then I pushed my changes and asked people to try
compiling Octave on other systems and I received a report about the
following error on an OS X system:

  In file included from /usr/include/sys/time.h:197,
                   from ../libgnu/sys/time.h:40,
                   from ../libgnu/sys/select.h:51,
                   from /usr/include/unistd.h:519,
                   from ../libgnu/unistd.h:29,
                   from 
/usr/include/c++/4.2.1/i686-apple-darwin10/bits/os_defines.h:61,
                   from 
/usr/include/c++/4.2.1/i686-apple-darwin10/bits/c++config.h:41,
                   from /usr/include/c++/4.2.1/cstddef:50,
                   from Array.h:30,
                   from MArray.h:28,
                   from dMatrix.h:27,
                   from ODESFunc.h:26,
                   from ODES.h:26,
                   from ODES.cc:27:
  ../libgnu/stdlib.h:737: error: previous declaration of ‘int _gl_warn_on_use’ 
with ‘C++’ linkage
  ../libgnu/time.h:350: error: conflicts with new declaration with ‘C’ linkage

so it seems that _gl_warn_on_use should be declared extern "C" to
avoid this kind of problem.  The attached change avoided the problem
for us, but I'm not sure whether it is the proper fix.

Thanks,

jwe

diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h
index d33cfe6..4af106f 100644
--- a/build-aux/warn-on-use.h
+++ b/build-aux/warn-on-use.h
@@ -87,6 +87,6 @@ extern rettype function parameters_and_attributes \
      __attribute__ ((__warning__ (msg)))
 # else /* Unsupported.  */
 #  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
-extern int _gl_warn_on_use
+_GL_EXTERN_C int _gl_warn_on_use
 # endif
 #endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]