GNU bug report logs - #25338
[PATCH] Remove local variable with only one usage

Previous Next

Package: emacs;

Reported by: Chris Gregory <czipperz <at> gmail.com>

Date: Mon, 2 Jan 2017 21:51:01 UTC

Severity: wishlist

Tags: notabug, patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #12 received at control <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chris Gregory <czipperz <at> gmail.com>
Cc: 25338 <at> debbugs.gnu.org
Subject: Re: bug#25338: [PATCH] Remove local variable with only one usage
Date: Sat, 07 Jan 2017 10:26:30 +0200
tags 25338 notabug
close 25338
thanks

> From: Chris Gregory <czipperz <at> gmail.com>
> Date: Mon, 02 Jan 2017 13:50:01 -0800

Thanks.

IMO, we are splitting hair here.  In an optimized build, a compiler
will optimize 'str' and keep the value in a register, so the variable
doesn't matter.  In a non-optimized build, the existence of the
variable allows to look at it in a debugger.  And the loop is small
enough so that an extra variable local to the loop doesn't make it
more complicated.

So I'd rather not make this change.




This bug report was last modified 8 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.