public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Ulrich Drepper <drepper@redhat.com>,
	Glibc hackers <libc-hacker@sources.redhat.com>
Subject: Re: [PATCH] Tweak assert -DNDEBUG for the new -Wunused-but-set-{variable,parameter} warnings
Date: Thu, 08 Apr 2010 10:49:00 -0000	[thread overview]
Message-ID: <m3y6gymd7v.fsf@hase.home> (raw)
In-Reply-To: <20100408102141.GO3601@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Thu, 8 Apr 2010 12:21:41 +0200")

Jakub Jelinek <jakub@redhat.com> writes:

> The following patch shouldn't result in worse code generation (not
> even with -O0 I believe) with -DNDEBUG, should quiet that warning
> and also allow some checking of expr.  With -DNDEBUG assert will
> happily accept even syntax errors within its arguments etc., which
> would only show up without -DNDEBUG, this patch ought to cure that
> too.  Alternative to the 0 && (expr) could be sizeof (expr) or
> something else where the expression isn't evaluated, but is parsed.

I don't think this is allowed, as the standard explicitly says that the
argument is ignored when NDEBUG is defined.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

  reply	other threads:[~2010-04-08 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 10:22 Jakub Jelinek
2010-04-08 10:49 ` Andreas Schwab [this message]
2010-04-08 17:54 ` Roland McGrath

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=m3y6gymd7v.fsf@hase.home \
    --to=schwab@redhat.com \
    --cc=drepper@redhat.com \
    --cc=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /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).