How can I make this GCC warning an error?

gcc, gcc-warning

Solution

I'm not sure what the correct warning is, but once you've found it, you can change its disposition with the following (using 'format' as the example):

#pragma GCC diagnostic error "-Wformat"

Or as strager points out:

gcc -Werror=format ...

I've checked the gcc source for this and this specific warning cannot be disabled via command line flags.

Problem

I get this warning from GCC: warning: cannot pass objects of non-POD type 'class Something' through '...'; call will abort at runtime It's pretty deadly, especially since it calls an abort. Why isn't this an error? I would like to make it an error, but: - How do I make a specific warning an error? - Which warning is it? According to 3.8 Options to Request or Suppress Warnings, `-Wno-invalid-offsetof`, it looks like the flag to hide it, but it doesn't.

Original source