Concise way to disable specific warning instances in Clang

As described in the Controlling Diagnostics via Pragmas article it would be:

#pragma clang diagnostic ignored "-Wpadded"

If you want to suppress a warning in a certain chunk of code (be it a single line of code or multiple statements) then you need to utilize the push / pop mechanism:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpadded"
// your code for which the warning gets suppressed 
#pragma clang diagnostic pop
// not suppressed here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)