This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21495] New: Assignment inside an assert statement should issue a warning
- From: "jimis at gmx dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 16 May 2017 19:21:11 +0000
- Subject: [Bug libc/21495] New: Assignment inside an assert statement should issue a warning
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21495
Bug ID: 21495
Summary: Assignment inside an assert statement should issue a
warning
Product: glibc
Version: unspecified
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: jimis at gmx dot net
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Having an assignment inside an if statement causes "gcc -Wall" to issue a
warning "suggest parentheses". However this does not happen for assert()
statements, hiding behaviour that can cause subtle but nasty side-effects.
Example code:
assert(param = NULL);
Compiling with gcc -Wall does not print any warning.
--
You are receiving this mail because:
You are on the CC list for the bug.