This is the mail archive of the gcc@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: Prefix attributes vs. grammar




> Would it be possible to have the parser accumulate any pre-prefix
> attributes and only process them when all decl specifiers have been
> seen?

Yes -- but just enumerating the places where they can go is pretty
horrid.  Still, using your technique it merely becomes a problem of
finding all the places.

We still don't really know what the attributes mean -- but at least
we would know what they bind to.

> That could even be used as the tighter definition of attribute
> locations ("may appear anywhere, but effect is as if had been placed
> after the last decl specifier before a declarator").  Still ugly, but
> no worse than some of the standardized C++ syntax... :-)

You're joking, but you're wrong.  :-)

Some of the standardized C++ syntax is clumsy, but this is truly
atrocious.  This invention makes C's regrettable declaration
syntax seem clean simple.

We do need to be sympathetic to existing code -- but we also need to
realize that if we accidentally change the semantics of existing code
that is even worse that just plain breaking it.  And if we don't know
what it's supposed to do, we will definitely break it.  A logician,
as opposed to an engineer, might then argue that it is better to
proactively break it.

My rant was really about two things: what to do here, and why we
must be much, much more careful in the future.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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