| Summary: | SDL appears to use enums instead of enum classes | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alex <alex> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | ||
| Version: | 2.0.9 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
|
Description
Alex
2019-11-19 19:07:51 UTC
Maybe we need an SDL_ENUM definition that resolves to enum in C and enum class for C++ at the appropriate revision? Alex, what version of Visual Studio are you running? I'm running what I believe to be the latest version: Visual Studio Community 2019 Version 16.3.9 (In reply to Alex from comment #0) > The discussion at the bottom of the MSDN page for this warning suggests > that developers should report this as a bug in APIs, so here I am. With respect to Microsoft, but this is _not_ a bug in external APIs, it's a C++-specific, overaggressive compiler warning about a common API pattern. We should probably just disable this warning within the scope of the SDL headers. Also, if we make these into "enum class" types, it'll break unsuspecting C++11 programs that include SDL.h and then try to do... SDL_bool x; x = SDL_TRUE; ...as this would become a compiler error. It would need to be "x = SDL_bool::SDL_TRUE;" --ryan. |