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: GCC's statement expression extension


In article <200007270551.WAA02353@penguin.transmeta.com> you write:
>And yes, you can get gcc to generate non-sensical code by using local
>labels in an expression statement.  But hey, gcc generates non-sensical
>code every time you give it nonsensical source - what's the big deal? If
>the programmer writes nonsense, then why should the compiler care?

>How about a new warning instead:

>	strange.c:14: warning: programmer appears seriously deranged

>and then let users decide themselves if they really want to use local
>labels inside expression statements..

In the long run, I believe that this approach loses.

Extensions need to have properly defined semantics, and anything that does
not have fixed down semantics would need to be flagged as a bug, and downright
not compile at all (not possible in the real world, of course).

See, the issue is that those constructs only have an implementation-defined 
meaning that might change from one release to the next because, well,
because it's not documented, and it's hard to keep track of what other changes
to that big fat gcc program are going to do.

The only result is that the notion of a `bug in gcc' gets very fuzzy, and
then we get people not upgrading because the new version is `buggy' (when,
in fact, the implementation details changed, and it does something different
with code which was utterly broken in the first place)

Of course, if resources were infinite, you would have lots of developers
being able to maintain undocumented features of gcc forever.

As things stand, I'd rather we concentrate on nailing down everything that
the standard wants, plus continuing working on lots of architecture, and 
trying to provide awesome optimizations, and getting a faster compiler.

Of course, this is only my opinion...

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