[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patches for flex 2.5.25 C compatibility and lint compatibility
From: |
Bruce Lilly |
Subject: |
Patches for flex 2.5.25 C compatibility and lint compatibility |
Date: |
Sun, 08 Dec 2002 16:17:03 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 |
Attached are two patches for flex 2.5.25.
compat.patch addresses C type issues related to vaious revisions
of ANSI C and K&R C. Both "long long" and int64_t (and uint64_t)
were introduced with C99, so appropriate typedefs are used in the
C99 preprocessor branch in flexint.h. The typedefs were removed
from the non-64-bit, non-C++ branch since "long long" is an error
prior to C99.
lint.patch revises the "/* fall through */" comment to "/*FALLTHROUGH*/"
which is recognized by lint and lclint (though the latter squawks
about it not being the lclint proprietary format).
Both patches have been tested on GNU/Linux (SuSE 8.0/gcc 2.95.3) and
UWIN 3.1 (MSVC++ 6.0 SP5).
compat.patch does not address the fact that the [u]intN_t types are
optional in C99; the typedefs in the C99 branch could be changed
to the required [u]int_leastN_t C99 types.
*** flexint.h.orig Sun Dec 8 15:39:24 2002
--- flexint.h Sun Dec 8 15:42:28 2002
***************
*** 13,34 ****
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
# if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus
typedef long int flex_int64_t;
- # else
- typedef long long int flex_int64_t;
# endif
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus
typedef unsigned long int flex_uint64_t;
- #else
- typedef unsigned long long int flex_uint64_t;
#endif
#endif /* ! C99 */
--- 13,32 ----
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
+ typedef int64_t flex_int64_t;
+ typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
# if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus
typedef long int flex_int64_t;
# endif
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus
typedef unsigned long int flex_uint64_t;
#endif
#endif /* ! C99 */
*** flex.skl.orig Sun Dec 8 15:46:41 2002
--- flex.skl Sun Dec 8 15:46:56 2002
***************
*** 1472,1478 ****
/* Reset buffer status. */
yyrestart( yyin YY_CALL_LAST_ARG);
! /* fall through */
case EOB_ACT_END_OF_FILE:
{
--- 1472,1478 ----
/* Reset buffer status. */
yyrestart( yyin YY_CALL_LAST_ARG);
! /*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- Patches for flex 2.5.25 C compatibility and lint compatibility,
Bruce Lilly <=