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]
Other format: [Raw text]

Re: compiler tweak offered


On Sun, Aug 25, 2002 at 08:31:19AM +0200, der Mouse wrote:
> I've finally gotten around to doing a hack to gcc I've been meaning to
> for a while, and I'm writing to offer it back to you people if you're
> interested.  It permits labeled control structure, as in
> 
> 	for "outer" (elt=root; elt; elt=elt->link)
> 	 { while (...)
> 	    { ...
> 	      switch (...)
> 	       { ....
> 		 if (...) continue "outer";
> 
> This affects do, for, while, switch, break, and continue statements.

I don't know about the other maintainers, but personally I
don't feel this extension adds enough expressiveness to 
warrent the maintanence hassle.  Really, this is just as
easily written as

	for (elt=root; elt; elt=elt->link)
	  {
	    while (...)
	      {
		if (...) goto continue_outer;
	      }
	    ...
	  continue_outer:;
	  }

> Unfortunately it does cause a reinterpretation of certain very unusual
> legal C code, namely, any do-loop whose body is a non-brace-bracketed
> statement beginning with a string literal...

In addition, this is a major strike against your proposal.


r~


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