Re: [Flex-devel] Direct yy_fatal_error instead of YY_FATAL_ERROR macro
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Aaron S. <aa...@se...> - 2008-12-05 19:28:02
|
On Tue, 2008-12-02 at 10:36 -0500, Joe Krahn wrote: > Aaron Stone wrote: > > In the code generated for a reentrant scanner, two functions call > > yy_fatal_error directly instead of going through the YY_FATAL_ERROR > > macro. I believe this to be an omission. Any objections to changing it? > ... > > Actually, I had changed this in my mega-patch. Oh cool, well then that makes two people who noticed this and made the same change, so I'll see about committing it. > > My modifications are > fairly extreme, so maybe it would be good if collected general bug-fixes > to incorporate into the current code? Ah, yes splitting things up is really good practice. Also, I had started to review your patches but then lost the message list I had open. Lame excuse, I know, but FYI that reading over your work is on my todo list. > Another thing I fixed is the yywrap() macro. The yywrap function has 1 > arg in the reentrant scanner, but zero otherwise. A blank argument is > valid for a macro, so yywrap(n) is actually valid code for an expression > using yywrap with either zero or one arguments. > > It turns out that at least one broken compiler considers this an error, > claiming that a 1-argument macro was given zero args. There are also > non-broken compilers that give warnings. In my modified code, I switched > to using alternate definitions for yywrap, on the basis that it is > reasonable to emit warnings in this situation, even though it really is > valid code. Interesting, I didn't know that! Aaron |