bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's behind this fix?


From: Paul Hilfinger
Subject: Re: What's behind this fix?
Date: Mon, 04 Oct 2010 13:10:04 -0700

 > > Is this new?  My copy of ISO 9899:1999
 > 
 > Yes, it's new.  Sorry, I should have made it clear
 > that I was referring to C89, which doesn't allow
 > empty macro arguments.  Bison is supposed to be portable to C89.

OK.  That makes rather more sense, then (although I think you may have
meant that the behavior of empty arguments was undefined in C89; at
least that's what the C99 Rationale implied.)

 > The rules for empty arguments in C99 are a bit confusing,
 > as you've noted, and code that explores the corners is likely
 > to expose spiderwebs in various implementations.  That being said,
 > it's pretty clear that "#define foo() etc" is OK: for example, it's
 > in one of the C99 examples.  It was also OK in C89, and this reflected
 > common practice in macro calls, e.g., getchar().
 > 
 > The topic is further discussed in pages 102-103 of the rationale
 > <http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf>.

Ah yes, language definition by "clarification".  I know it well, having
practiced it in the Ada world.  Of course, this is nothing compared to
an example from Algol 68, where the (after the official definition was
set in stone), the designers issued an interpretation that amounted to
"The phrase 'X is Y' in the reference shall be interpreted to mean 'X is
not Y.'"

Paul H.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]