[cfe-commits] [PATCH] Suppress -Wunused-value for explicit casts in macros
matthewbg at google.com
Tue Oct 23 16:23:50 PDT 2012
On Tue, Oct 23, 2012 at 4:19 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Tue, Oct 23, 2012 at 1:48 PM, Matt Beaumont-Gay <matthewbg at google.com> wrote:
>> The motivating case here is that OpenSSL has some code like this:
>> static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
>> #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
>> That cast to int causes client code which calls BIO_flush and ignores
>> the result to get a -Wunused-value warning.
> (I don't suppose there's any way to narrow this down to ensure it's
> logically at the outer most scope of the macro?)
I guess we could try to be more clever, but I'd want to see some
evidence that the effort would be worthwhile.
More information about the cfe-commits