public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "james dot kanze at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/29834] g++ thinks it is a declaration when it cannot be
Date: Wed, 15 Nov 2006 10:10:00 -0000	[thread overview]
Message-ID: <20061115101027.25732.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29834-9635@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from james dot kanze at gmail dot com  2006-11-15 10:10 -------
Subject: Re:  g++ thinks it is a declaration when it cannot be

On 15 Nov 2006 01:59:33 -0000, bangerth at dealii dot org
<gcc-bugzilla@gcc.gnu.org> wrote:

> > (Note that in the actual code, Doh was
> > boost::mutex::scoped_lock.  And I fear that using
> > boost::mutex::scoped_lock like this is becoming a widespread
> > idiom.)

> Ugh, this isn't an easy to read idiom...

Not sure I like it myself.  It has two advantages: you don't
have to invent a name for a variable that you are never going to
use, and you don't have to add braces to limit the scope of the
lock.  Very meager advantages, IMHO: it doesn't bother me to
just throw in any short name (e.g. 'l') in such cases, and if
the function is large enough to require the extra braces, it's
probably too large and complicated anyway.

But I'm not the only programmer in the world, and some people
seem to actually like it.  And... I'll use it too, in quick
hacks in throw-away code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29834


  parent reply	other threads:[~2006-11-15 10:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 16:36 [Bug c++/29834] New: " james dot kanze at gmail dot com
2006-11-14 21:33 ` [Bug c++/29834] " rguenth at gcc dot gnu dot org
2006-11-15  1:59 ` bangerth at dealii dot org
2006-11-15 10:05 ` james dot kanze at gmail dot com
2006-11-15 10:10 ` james dot kanze at gmail dot com [this message]
     [not found] <bug-29834-4@http.gcc.gnu.org/bugzilla/>
2012-10-11 21:54 ` pinskia at gcc dot gnu.org
2013-07-02 10:25 ` ace.of.zerosync at gmail dot com
2013-07-02 10:49 ` redi at gcc dot gnu.org
2013-07-02 12:10 ` ace.of.zerosync at gmail dot com
2013-07-02 15:04 ` james.kanze at gmail dot com
2013-07-02 17:16 ` manu at gcc dot gnu.org
2013-07-02 21:38 ` ace.of.zerosync at gmail dot com
2013-07-02 21:48 ` ace.of.zerosync at gmail dot com
2013-07-13  1:53 ` ace.of.zerosync at gmail dot com
2024-02-07 17:36 ` pinskia at gcc dot gnu.org
2024-02-07 17:57 ` mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061115101027.25732.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).