octave-maintainers
[Top][All Lists]
Advanced

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

safer way to use gnulib


From: Jaroslav Hajek
Subject: safer way to use gnulib
Date: Sat, 20 Feb 2010 18:51:21 +0100

hi all,

apparently the gnulib portability library caused a lot of new
portability problems for us. It seems that the way it works, i.e.
redefining common names to rpl_ replacements, is just too intrusive to
be safely used in C++.

Resigning on using gnulib at all would be a step backwards.

I think we should use gnulib in a much stricter manner. I suggest we
create a library of replacement system functions, say, liboctsys, that
will be written exclusively in C with using gnulib. libsysrep will
define functions like

octave_sys_open
octave_sys_fnmatch

etc. The important restriction is that we shall *NOT* include any of
the gnulib replacement header files in any of the octave_sys header
files. We shall also *NOT* use -I ./libgnu when compiling liboctinterp
and liboctave.

In cases where this would be needed (for instance when gnulib wants to
redefine macros or structs) we shall resort to autoconf magic to
extract this stuff from gnulib an insert it into octave_sys headers in
a safe manner.
This way we shall avoid random #defines for common names such as
"open", "close", "sleep" or "round" leaking into our headers, which
apparently can confuse not only Octave's code (where we can work it
around) but also standard C++ headers (where we can't) or user C++
extensions (where users will no doubt become quite unpleased).

What do you think? It seems that in the current state of affairs
gnulib actually makes Octave less portable than before.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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