From: John Millaway Date: Thu, 5 Sep 2002 18:21:04 +0000 (+0000) Subject: Flex generates C99 defs now. X-Git-Tag: flex-2-5-20~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19b7d283448f4e0bbebbf4dbee94a4fb793a32d2;p=flex Flex generates C99 defs now. Documented the above change in manual. --- diff --git a/flex.skl b/flex.skl index a81f1ec..ee337d8 100644 --- a/flex.skl +++ b/flex.skl @@ -30,6 +30,7 @@ #include #include #include +#include /* end standard C headers. */ %+ /* begin standard C++ headers. */ @@ -55,14 +56,8 @@ #else /* ! __cplusplus */ /* We're not in a C++ compiler, so by default, - we generate traditional function defs, unless you explicitly ask - for C99 defs. */ - -#ifndef YY_NO_TRADITIONAL_FUNC_DEFS -#ifndef YY_TRADITIONAL_FUNC_DEFS -#define YY_TRADITIONAL_FUNC_DEFS -#endif -#endif + we generate C99 function defs, unless you explicitly ask + for traditional defs by defining YY_TRADITIONAL_FUNC_DEFS */ #if __STDC__ diff --git a/flex.texi b/flex.texi index 81c7e28..bee6a84 100644 --- a/flex.texi +++ b/flex.texi @@ -1427,13 +1427,15 @@ and taking two floats as arguments. Note that if you give arguments to the scanning routine using a K&R-style/non-prototyped function declaration, you must terminate the definition with a semi-colon (;). -@code{flex} generates K&R-style function definitions by default. This is solely -to support bootstrapping gcc on old systems. Worse, it prevents us from using -any standard data types smaller than int (such as short, char, or bool) as -function arguments. For this reason, future versions of @code{flex} may -generate standard C99 code, leaving K&R-style functions to the historians. -Currently, if you want C99 definitions, then you'll have to define -@code{YY_NO_TRADITIONAL_FUNC_DEFS}. +@code{flex} generates @samp{C99} function definitions by default. However flex +does have the ability to generate obsolete, er, @samp{traditional}, function +definitions. This is to support bootstrapping gcc on old systems. +Unfortunately, traditional definitions prevent us from using any standard data +types smaller than int (such as short, char, or bool) as function arguments. +For this reason, future versions of @code{flex} may generate standard C99 code +only, leaving K&R-style functions to the historians. Currently, if you do +@strong{not} want @samp{C99} definitions, then you must define +@code{YY_TRADITIONAL_FUNC_DEFS}. @cindex stdin, default for yyin Whenever @code{yylex()} is called, it scans tokens from the global input