This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Tweak assert -DNDEBUG for the new -Wunused-but-set-{variable,parameter} warnings


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]