Red Hat Bugzilla – Bug 145524
assignments in assert statements - avoid ?
Last modified: 2007-11-30 17:10:58 EST
Description of problem:
I just had a look at the source code for glibc-2.3.4-3
I found the following assignment statements nested into assert statement.
../BUILD/glibc-20041219T2331/iconv/strtab.c: assert (endp = retval +
../BUILD/glibc-20041219T2331/stdio-common/tst-ungetc.c: assert ((c =
getc (fp)) == 'a');
(link->thread.prevp = &ss->active_resources);
I'm not saying this code is wrong - just deeply suspicous.
The code will do different things, depending on wether the assert
statements are switched in or out.
Suggest code rework to avoid such assignment statements in assert
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Thanks. strtab.c and sigunwind.c fixed in CVS, tst-ungetc.c doesn't use the
normal assert, but defines its own assert macro, so there is no bug there.