[C++ PATCH]: Fix 11595

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Sep 6 19:11:00 GMT 2003

Jason Merrill <jason@redhat.com> writes:

| On 06 Sep 2003 17:27:42 +0200, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| > Jason Merrill <jason@redhat.com> writes:
| >
| > | The use of POP_TIMEVAR_AND_RETURN seems unnecessary here.  In fact, it's
| > | not clear to me why it would ever be useful to combine the two operations.
| > | Gaby?
| >
| > It is an automated way to ensure that functions with multiple
| > return-statements consistently pop the timevar stack in the return
| > statements. 
| But it's not automated--it requires that you repeat it for each return,

yes, a really fully automated, compiler-assisted scheme would certainly
have been better. 

| which seems no less complicated than repeating a normal pop at each return,

I've tested either way when preparing the patch at the time and the way
you're describing proved to be more error-prone than the
POP_TIMEVAR_AND_RETURN thingy.  But I do not have strong opinion about
it if not pratice.  I've just observed that, in practice, the
capitalized macro name in the function body tends to ring more bells than
the other way. 

| though I suppose the use of a long, capitalized macro name makes it stand
| out more.

-- Gaby

More information about the Gcc-patches mailing list