Details
-
Type:
False-Positive
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.0
-
Fix Version/s: Subject: Driver, Importance: Relevant, Level: Easy
-
Component/s: Compiler Driver
-
Labels:None
Description
We should consider "-fshort-enums" in GCC and Clang based drivers, clang::LangOptions has ShortEnums flags which should be enabled.
Reproducer from report:
typedef enum { enum_value_0 = 0, enum_value_1 } short_enum_t; int func(unsigned char p) { return p; } int main(void) { short_enum_t val = enum_value_1; return func(val); // <-- code smell, implicit conversion loses integer precision: 'short_enum_t' to 'uint8_t' (aka 'unsigned char') }
Attachments
Issue Links
- contributes to
-
CPP-3450 Improve Clang/GCC and other driver(s)
-
- Closed
-
- links to