Avoid bogus gcc warnings about unused results
commit4ad9f15170414086331004efc8d5d77ede5e20a0
authorLinus Torvalds <torvalds@g5.osdl.org>
Sat, 8 Jul 2006 20:35:09 +0000 (8 13:35 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 8 Jul 2006 20:35:09 +0000 (8 13:35 -0700)
tree5757a4022522bce6acfff0c769373e062086dbfb
parentad1013d690066546ece6077463ac1d4d81bc8a60
Avoid bogus gcc warnings about unused results

Our fancy type-safe pointer-list template macros caused gcc to spew out
incredible numbers of totally bogus warnings, just because most users
didn't actually care about the result of the "add_ptr_list()" operation.

Not caring about the result is _fine_, and gcc is just totally confused.

However, we can avoid the bogus warning by enclosing the expression in a
statement expression.  While "(cast)(x)" causes a warning about the
result not being used, doing it as "({ (cast)(x); })" shuts gcc up about
it.

Not pretty, but better than the alternative (which is to drop type
information).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ptrlist.h