[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flex beta 2.5.24 released [integral types]
From: |
Bruce Lilly |
Subject: |
Re: flex beta 2.5.24 released [integral types] |
Date: |
Mon, 25 Nov 2002 14:37:12 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910 |
Preliminary report on 2.5.24 portability issues:
tested on SuSE Linux 8.0, builds, runs make check OK, but
there are compilation warnings, e.g.
In file included from /usr/include/netinet/in.h:23,
from flexdef.h:127,
from tables_shared.c:45:
/usr/include/stdint.h:171: warning: `UINT8_MAX' redefined
flexint.h:56: warning: this is the location of the previous definition
/usr/include/stdint.h:172: warning: `UINT16_MAX' redefined
flexint.h:59: warning: this is the location of the previous definition
The issue is that flexint.h defines UINT8_MAX as (255U) whereas
the system header stdint.h simply uses (255) etc.
The U suffix is an ANSI addition, so I can see that there will almost
certainly be problems compiling with K&R compilers. A possible
solution would be something like:
#ifndef UINT8_MAX
#if __STDC__
#define UINT8_MAX (255U)
#else
#define UINT8_MAX (255)
#endif
#endif
etc. Not that the test is
#if __STDC__
not
#ifdef __STDC__
as it is reported that some K&R compilers define __STDC__ as zero.
I haven't yet tried other systems or checked for portability issues
with built .c files.