Skip to content
Commit a4f597f0 authored by Aaron Ballman's avatar Aaron Ballman
Browse files

Reapply: Silence false positive diagnostics regarding passing an object of...

Reapply: Silence false positive diagnostics regarding passing an object of enumeration type to va_start().

The underlying type for an enumeration in C is either char, signed int, or unsigned int. In the case the underlying type is chosen to be char (such as when passing -fshort-enums or using __attribute__((packed)) on the enum declaration), the enumeration can result in undefined behavior. However, when the underlying type is signed int or unsigned int (or long long as an extension), there is no undefined behavior because the types are compatible. This patch silences diagnostics for the latter while retaining the diagnostics for the former.

This patch addresses PR29140.

llvm-svn: 281632
parent 886a542e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment