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


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

[Bug libc/21495] New: Assignment inside an assert statement should issue a warning


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.

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