[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: safer way to use gnulib
From: |
Ben Abbott |
Subject: |
Re: safer way to use gnulib |
Date: |
Tue, 16 Mar 2010 07:38:14 -0400 |
On Mar 15, 2010, at 5:10 PM, John W. Eaton wrote:
> On 20-Feb-2010, Jaroslav Hajek wrote:
>
> | On Sat, Feb 20, 2010 at 8:49 PM, John W. Eaton <address@hidden> wrote:
> | > On 20-Feb-2010, John W. Eaton wrote:
> | >
> | > | On 20-Feb-2010, Jaroslav Hajek wrote:
> | > |
> | > | | What do you think? It seems that in the current state of affairs
> | > | | gnulib actually makes Octave less portable than before.
> | > |
> | > | Please see the following thread on the gnulib mailing list:
> | > |
> | > | http://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00113.html
> | > |
> | > | The last method proposed in that thread would allow us to use gnulib
> | > | without having to modify Octave, and it would avoid the problems we
> | > | have with the rpl_ definitions.
> | >
> | > Looking at the thread in the archive, I realize that it may be a bit
> | > confusing to know precisely which messages I'm talking about here.
> | > The "last method proposed" is here:
> | >
> | > http://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00142.html
> | >
> | > and Bruno Haible's response is here:
> | >
> | > http://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00143.html
> | >
> | > jwe
> | >
> |
> | It looks good. I don't think why enclosing #include inside namespace
> | should not work. #include directives are handled by the preprocessor.
> | The only problem might be with other #defines used by the system
> | library, but we can hardly do anything about that.
>
> Bruno Haible has checked in his c++defs module to the gnulib archive
> and I checked in the following change to make Octave use the new
> scheme of referencing gnulib replacement functions in C++ as
> gnulib::FCN.
>
> http://hg.savannah.gnu.org/hgweb/octave/rev/479cc8a0a846
>
> These changes should avoid the problems with gnulib defining rpl_*
> functions. If you had trouble with these definitions in the past,
> please try updating (including your gnulib sources), removing your
> local fixes for the problems, and rebuilding.
>
> Bruno's changes did not go as far as putting the system headers inside
> a namespace, so we do have to prefix all replacement functions with
> the namespace tag. But we also get some help if we are using GCC.
> Calls to functions that might be replaced generate warnings of the
> form
>
> lex.cc:3659: warning: call to 'fprintf' declared with attribute warning: The
> symbol ::fprintf refers to the system function. Use gnulib::fprintf instead.
>
> Since these warnings for lex.cc and oct-parse.cc occur in generated
> code that (I think) does not have problems with the redefinitions, I
> chose to avoid the warnings there by undefining GNULIB_NAMESPACE after
> config.h is included.
>
> Please let me know if you see any further problems related to the
> gnulib symbol definitions.
>
> jwe
I'm not sure this is related, but with my tip as ...
$ hg tip
changeset: 10412:d2ac9433cd09
tag: tip
user: John W. Eaton <address@hidden>
date: Mon Mar 15 16:56:14 2010 -0400
summary: append AM_CPPFLAGS to libcruft_la_CPPFLAGS
... compiling octave fails with the error below.
/bin/sh ../libtool --tag=CXX --mode=compile g++-4.2 -DHAVE_CONFIG_H -I. -I..
-I/sw/lib/flex/include -I/sw/include -O0 -g -m32
-I/sw/include/freetype2 -I/sw/include/qhull -I/usr/include -I../libgnu
-I../libgnu -I../libcruft/misc -I/sw/lib/flex/include -I/sw/include -O0 -g -m32
-I/sw/include/freetype2 -I/sw/include/qhull -I/usr/include -I/sw/include -O0 -g
-m32 -D_THREAD_SAFE -D_REENTRANT -DHAVE_CONFIG_H -mieee-fp -I/sw/include
-I/sw/include/freetype2 -I/sw/include -I/usr/X11/include -Wall -W -Wshadow
-Wold-style-cast -Wformat -I/sw/include -O0 -g -m32 -D_THREAD_SAFE -D_REENTRANT
-D_THREAD_SAFE -pthread -I/sw/include -O0 -g -m32 -D_THREAD_SAFE -D_REENTRANT
-MT liboctave_la-ODES.lo -MD -MP -MF .deps/liboctave_la-ODES.Tpo -c -o
liboctave_la-ODES.lo `test -f 'ODES.cc' || echo './'`ODES.cc
libtool: compile: g++-4.2 -DHAVE_CONFIG_H -I. -I.. -I/sw/lib/flex/include
-I/sw/include -O0 -g -m32 -I/sw/include/freetype2 -I/sw/include/qhull
-I/usr/include -I../libgnu -I../libgnu -I../libcruft/misc
-I/sw/lib/flex/include -I/sw/include -O0 -g -m32 -I/sw/include/freetype2
-I/sw/include/qhull -I/usr/include -I/sw/include -O0 -g -m32 -D_THREAD_SAFE
-D_REENTRANT -DHAVE_CONFIG_H -mieee-fp -I/sw/include -I/sw/include/freetype2
-I/sw/include -I/usr/X11/include -Wall -W -Wshadow -Wold-style-cast -Wformat
-I/sw/include -O0 -g -m32 -D_THREAD_SAFE -D_REENTRANT -D_THREAD_SAFE -pthread
-I/sw/include -O0 -g -m32 -D_THREAD_SAFE -D_REENTRANT -MT liboctave_la-ODES.lo
-MD -MP -MF .deps/liboctave_la-ODES.Tpo -c ODES.cc -fno-common -DPIC -o
.libs/liboctave_la-ODES.o
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
Ben
Re: safer way to use gnulib, Jaroslav Hajek, 2010/03/16