This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: unnamed #pragma fails to compile


On Fri, Feb 25, 2000 at 08:21:11AM -0300, Alexandre Oliva wrote:
> The following testcase, just installed in the testsuite, fails to
> compile with the current CVS.
> 
> Here's a patch that arranges for unnamed pragmas to be accepted, as
> required by the C Standard.  Ok to install?

Well, technically, a pragma with no tokens causes implementation-
defined behavior, but it would seem to fall under the category of
'unrecognized pragmas must be ignored'.  The wording in this segment
could be a lot better.

So the intent of the patch is fine.  I don't like the implementation -
what's with the spaghetti code?  You appear to have been trying to
remove the duplicate cleanup code, but I would rather you leave it
duplicated and not put a goto into the middle of a conditional block.
Furthermore, the name skip_no_error is misleading since you don't
actually call skip_rest_of_line.  Just put an 'empty' label right
after the skip_rest_of_line call at the end of the function, and go
straight there from if (token == CPP_VSPACE).

With that change, the patch is approved.

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]