[llvm-commits] [llvm-gcc] Changes In Boolean (please commit)
Jeff Cohen
jeffc at jolt-lang.org
Thu Jan 11 14:14:57 PST 2007
When diffing the code generated by my version of flex against
Lexer.cpp.cvs, and excluding the #line directives, I get this:
23,24c23
< * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10
16:58:48 vern Exp $
< * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.8 2004/01/06 19:03:44 nectar
Exp $
---
> * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.22
2007/01/11 18:21:28 reid Exp $
27,32d25
< #if defined(__FreeBSD__)
< #include <sys/cdefs.h>
< #else
< #define __unused
< #endif
<
37a31
> #include <unistd.h>
51d44
< #include <unistd.h>
162a156,164
> /* Some routines like yy_flex_realloc() are emitted as static but are
> not called by all lexers. This generates warnings in some compilers,
> notably GCC. Arrange to suppress these. */
> #ifdef __GNUC__
> #define YY_MAY_BE_UNUSED __attribute__((unused))
> #else
> #define YY_MAY_BE_UNUSED
> #endif
>
269c271
< static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
__unused;
---
> static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
YY_MAY_BE_UNUSED;
1178c1180
< register char *yy_cp, *yy_bp;
---
> register char *yy_cp = NULL, *yy_bp = NULL;
1244,1245c1246
< goto find_rule; /* avoid `defined but not used' warning */
< find_rule: /* we branch to this label when backing up */
---
>
2396a2398
> #ifndef YY_NO_INPUT
2470c2472
<
---
> #endif /* YY_NO_INPUT */
2581,2585d2582
< #ifndef YY_ALWAYS_INTERACTIVE
< #ifndef YY_NEVER_INTERACTIVE
< extern int isatty YY_PROTO(( int ));
< #endif
< #endif
FreeBSD has it's own solution to suppressing the warning: just throw in
a gratuitous "goto find_rule".
Looking at this diff, it looks like it may not be a good idea to catch
the output of flex. It isn't as platform-independent as we'd like.
Unfortunately, some platforms don't come with flex as standard
equipment. No obvious easy solution.
More information about the llvm-commits
mailing list