Ilya Zakharevich on Mon, 27 Dec 2004 13:38:33 +0100


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

Yet another _overflow problem


I traced the problem with the build of Math::Pari on MacOS to the
following piece of code:

src/kernel/none/level0.h :

  ulong overflow;
  ulong hiremainder;

This works only accidentally; in particular, if the default for the C
compiler is -fno-common, these are global variables which are not
common/bss, so the linker gets in a lot of trouble with duplicate
declarations.

What is the intent of these declarations: to make the variables
static, or global?  In the latter case, is not it better to replace
this branch by

  extern ulong overflow;
  extern ulong hiremainder;
  #define NEED_OVERFLOW_HIREMAINDER

and put

  #ifdef NEED_OVERFLOW_HIREMAINDER
  ulong overflow;
  ulong hiremainder;
  #endif

in an appropriate C file?

Puzzled,
Ilya