tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] about patch: support c99 for-loop init decls


From: grischka
Subject: [Tinycc-devel] about patch: support c99 for-loop init decls
Date: Tue, 08 Mar 2011 15:00:03 +0100
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

This patch:
http://repo.or.cz/w/tinycc.git/commitdiff/e23194a1fa2ca176c9151964a2e035f36736e650

moves code that belongs to block()
  -            gexpr();
  -            vpop();
into decl0()
  +                gexpr();
  +                vpop();

which is structurally un-nice.

I'd rather let decl0() just do the c99 case and return a value, and then
use like this in block():

         if (tok != ';') {
           if (!decl0(VT_LOCAL, 1)) { /* c99 loop variable */
             gexpr();
             vpop();
           }
         }

Also no need to wrap into a function for only one use, IMO.

Thanks,

--- grischka




reply via email to

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