We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4253

Summary: GCC Warnings: ANSI-C90 violation in SDL_video.h and SDL_sensor.h public headers
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: One of fragment contains a C90 violation

Description Vitaly Novichkov 2018-09-06 21:45:32 UTC
Created attachment 3299 [details]
One of fragment contains a C90 violation

Hello!
Just now I have caught several warnings in your public headers are caused by a comma at end of enumerator list:

```
SDL_sensor.h:74: предупреждение: comma at end of enumerator list [-Wpedantic]
     SDL_SENSOR_GYRO,            /**< Gyroscope */
                    ^

SDL_video.h:178: предупреждение: comma at end of enumerator list [-Wpedantic]
     SDL_DISPLAYEVENT_ORIENTATION,   /**< Display orientation has changed to data1 */
                                 ^
SDL_video.h:187: предупреждение: comma at end of enumerator list [-Wpedantic]
     SDL_ORIENTATION_PORTRAIT_FLIPPED,   /**< The display is in portrait mode, upside down */
                                     ^
```
Comment 1 Ozkan Sezer 2018-09-07 00:01:22 UTC
Why do you use -pedantic ?

There are more scary warnings, e.g. with gcc-4.4 on CentOS6
a million of -Wstrict-aliasing from mainly but not limited to
joystick layer.  Speaking for myself, -pedantic warnings like
those comma at the end of enumerator list, are just annoyance.
Comment 2 Vitaly Novichkov 2018-09-07 07:23:57 UTC
(In reply to Ozkan Sezer from comment #1)
> Why do you use -pedantic ?

I having a library which partually does using of SDL2 (Mainly for RWops support), and the library is intended to be compatible with any compiler include some ancient of them. Then, I think, I'll try to include into that library the SDL_RWops only to avoid including of useless stuff.


> There are more scary warnings, e.g. with gcc-4.4 on CentOS6
> a million of -Wstrict-aliasing from mainly but not limited to
> joystick layer.  Speaking for myself, -pedantic warnings like
> those comma at the end of enumerator list, are just annoyance.

The only reason to enable them is polishing the compatibility for older compilers where are those "warnings" are errors.
Comment 3 Ozkan Sezer 2018-09-07 07:48:35 UTC
Fixed by https://hg.libsdl.org/SDL/rev/a3c2b6e89522