[PATCH] configure: Check for -Wno-pragma-pack

Martin Storsjö martin at martin.st
Mon Jan 22 15:42:07 CST 2018

On Mon, 22 Jan 2018, Thomas Faber wrote:

> On 2018-01-21 23:05, Martin Storsjo wrote:
>> Recent clang versions warn if an include file changes the pragma
>> pack level without restoring it before the end of the include file.
>> This avoids warnings for each include of pshpack*.h/poppack.h.
> Do you think a #pragma clang diagnostic inside those headers would be 
> feasible, to avoid hiding true positive instances of this warning?

I tested this now. It's easy to get rid of the warnings from the 
pshpack*.h files (by e.g. #pragma clang diagnostic push, #pragma clang 
diagnostic ignored "-Wpragma-pack").

Bbut if I do "#pragma clang diagnostic pop" within poppack.h, the warning 
is enabled again once the end of poppack.h is reached, and the 
warning gets triggered at the end of the source file. So each 
pair of pshpack*.h/poppack.h would need disabling the warning 
ignoring again after the #include "poppack.h".

Do you have any suggestions on how to handle that better, or is it just 
simplest to go for the blanket ignore?

// Martin

More information about the wine-devel mailing list