[m-dev.] More <inttypes.h> problems :-)

Warwick Harvey wharvey at cs.monash.edu.au
Mon Jun 7 17:01:03 AEST 1999


Hi,

I appear to have discovered a more fundamental flaw in the inttypes, 
sys/types, stdint changes, which means one cannot (currently) compile the 
asm_fast, etc. grades on Red Hat 6.0 Linux systems (it uses asm_jump 
instead).

This problem may affect any systems on which Mercury uses a system-supplied 
header file to defined types.

On Red Hat 6.0 systems, the inttypes.h header file contains inline 
functions, which means any subsequent declaration of global registers will 
fail.  This is why mercury_imp.h starts with a big warning saying that it 
must be the first header file included, and in particular before any system 
header files.  Unfortunately, mercury_regs.h, which (indirectly) declares 
the global registers first includes mercury_types.h to define the 
appropriate types.  But if inttypes.h or similar exist, mercury_types.h 
includes it, breaking the requirement that no system header files be 
included first.

May I ask what the rationale for using these files was?  The compiler has to 
cope with them not existing (i.e. it defines its own types if it can't use 
ones defined by the system), and there have been a number of problems with 
the use of them on a number of systems already, so I'm just wondering what 
they gain us
(the simplest solution to the above problems seems to be to abandon the use 
of the inttypes.h file).

Warwick

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list