[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] [#46 termio vs ptermio] additional information
From: |
anonymous |
Subject: |
[Axiom-developer] [#46 termio vs ptermio] additional information |
Date: |
Mon, 24 Jan 2005 21:39:44 -0600 |
=========================================================================================
| Gabriel,
|
| Steve Wilson points out that the CHANGELOG contains the lines:
|
| 20041116 tpd src/clef/edible.c termios -> termio
| 20040730 sxw src/clef/edible.c termio -> termios
|
| so it appears that on some systems we need termio and
| on others we need termios.
I see. I can confirm that on GNU/Linux, and generally (recent) glibc
systems, one needs termios. I also looked on solaris plateforms
(apparently currently not supported by axiom), one needs termios there
too.
I guess that is something one would need to test for at configure time.
| Steve believes that this is dead code because at the top
| of the file we see:
|
| #ifdef unlikely
| ...
| #define logterm
|
| and the termios code is protected by
| #ifdef logterm
I can see that the fragment is guarded by
#ifdef logterm
but for some reasons that code is reached on my system (SuSE-9.0,
with glibc-2.3.2).
GCC with the option -dM dumps macros that are defined. I can confirm
that gcc -E -dM edible.c shows a line where logterm is defined. More
precisely, I have the following
[....]
#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
#define _GCC_SIZE_T
#define CEOT CEOF
#define logterm 1 /* <===== here */
#define __INO64_T_TYPE __UQUAD_TYPE
#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
#define _IO_LINKED 0x80
[....]
so my gut feeling is that that macro gets defined as internal to some
system header files.
That gut feeling turns out to be wrong, as replacing logterm with
AXIOM_LOGTERM throughout edible.c still leads to the same problem.
So I operated on a second assumption: the macro "unlikely" must have
been defined somewhere else. Bingo! With the help of gcc -E -dM, I
could spot
[...]
#define __KEY_T_TYPE __S32_TYPE
#define sigev_notify_function _sigev_un._sigev_thread._function
#define likely(x) __builtin_expect((x),1) /* <==== here */
#define FAPPEND O_APPEND
#define _XOPEN_ENH_I18N 1
[...]
#define F_ULOCK 0
#define errno (*__errno_location ())
#define unlikely(x) __builtin_expect((x),0) /* <=== here too */
#define EL2NSYNC 45
#define _IO_off64_t _G_off64_t
[...]
I can't tell you right now which system header files define those
questionable macros (I know what they mean, but I don't see what they
are doing there). It seems that some glibc-based systems have taken
the right to hijack those names.
Maybe Axiom might prefer to spell its macros all in caps, and probably
prefixed with AXIOM_ ...
--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden