[cfe-dev] Option to disable POD check for variadic functions

Douglas Gregor dgregor at apple.com
Sat May 21 12:13:01 PDT 2011


On May 21, 2011, at 11:58 AM, Tomasz Dabrowski wrote:

> On 21 May 2011 18:34, Douglas Gregor <dgregor at apple.com> wrote:
>>> Possibility to ignore POD check would be very helpful.
>> 
>> 
>> Actually, the ability to disable the check is already in Clang, and the clue is right there in the diagnostic text: the [-Wnon-pod-varargs] at the end of the error tells you which warning flag controls this warning. So, pass -Wno-error=non-pod-varargs to downgrade it to a warning, or -Wno-non-pod-varargs to turn off the warning/error completely.
> 
> Yes, but this only hides error/warning, doesn't make actual vararg
> call work. I'll check trunk version, thanks for update.


The vararg call isn't going to work, because it can't. Now, there's still a bug here---we should be generating a __builtin_trap in this case---but passing non-POD/non-trivial types through varags is undefined behavior, for which we generally trap. 

	- Doug



More information about the cfe-dev mailing list