Small patch to fix warning

hi

attached is a small patch that fixes a gcc warning

greetings
martin
-------------- next part --------------
A non-text attachment was scrubbed…
Name: 0001-fixed-gcc-warning.diff
Type: text/x-patch
Size: 567 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110429/c36ecb2e/attachment.bin

What version of GCC are you using? Trailing commas are allowed by the
standard.

http://stackoverflow.com/questions/792753/is-the-last-comma-in-c-enum-required/792767#792767On Thu, Apr 28, 2011 at 10:20 PM, Martin Gerhardy <martin.gerhardy at gmail.com wrote:

hi

attached is a small patch that fixes a gcc warning

greetings
martin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Matthew Orlando
http://cogwheel.info

I use gcc and g++ version 4.6:

Code:
gcc version 4.6.1 20110329 (prerelease) (Debian 4.6.0-2)

I’m getting this with I think it was the “-pedantic” option:

Code:
/usr/i586-mingw32msvc/include/SDL/SDL_assert.h:103: warning: comma at end of enumerator list

( This version is: gcc version 4.4.4 (GCC) )

I removed the comma from my Linux-SDL-code, so the warning won’t appear.

Matthew Orlando wrote:

What version of GCC are you using? Trailing commas are allowed by the standard.

http://stackoverflow.com/questions/792753/is-the-last-comma-in-c-enum-required/792767#792767 (http://stackoverflow.com/questions/792753/is-the-last-comma-in-c-enum-required/792767#792767)

hi

attached is a small patch that fixes a gcc warning

greetings
martin


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


Matthew Orlando
http://cogwheel.info (http://cogwheel.info)
[/code]> On Thu, Apr 28, 2011 at 10:20 PM, Martin Gerhardy <martin.gerhardy at gmail.com (martin.gerhardy at gmail.com)> wrote:

I use gcc and g++ version 4.6:

I’m getting this with I think it was the “-pedantic” option:
Code:

/usr/i586-mingw32msvc/include/SDL/SDL_assert.h:103: warning: comma at end
of enumerator list

( This version is: gcc version 4.4.4 (GCC) )

I removed the comma from my Linux-SDL-code, so the warning won’t appear.

You could add

-std=C99On Fri, Apr 29, 2011 at 2:25 PM, Kakarott wrote:

You could add

-std=C99

Make that

-std=c99–
Matthew Orlando
http://cogwheel.info

    You could add
    
    
    -std=C99

Make that

-std=c99

of course one could add that - but that’s not the point imo. SDL can use
whatever c version it wants, but should not force the users of sdl to
use a particular compiler option or c version (resp. should allow to
compile your software without warnings with -pedantic imo). and as this
header is included by SDL.h everyone using -pedantic will get these
warnings.

Hello !

of course one could add that - but that’s not the point imo. SDL can use
whatever c version it wants, but should not force the users of sdl to
use a particular compiler option or c version (resp. should allow to
compile your software without warnings with -pedantic imo). and as this
header is included by SDL.h everyone using -pedantic will get these
warnings.

When it is possible, by just removing a “,” to make old compilers happy,
then we should do it. It is the same thing with /* */ and //

CU

I understand that, and agree. I just think it’s time to move on from C89 ;)On Sat, Apr 30, 2011 at 11:21 AM, Torsten Giebl wrote:

Hello !

of course one could add that - but that’s not the point imo. SDL can use

whatever c version it wants, but should not force the users of sdl to
use a particular compiler option or c version (resp. should allow to
compile your software without warnings with -pedantic imo). and as this
header is included by SDL.h everyone using -pedantic will get these
warnings.

When it is possible, by just removing a “,” to make old compilers happy,
then we should do it. It is the same thing with /* */ and //

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Matthew Orlando
http://cogwheel.info

Hi,
I agree with you Matthew i think we should switch to C99.
Have a nice day,On Sun, May 1, 2011 at 4:10 AM, Matthew Orlando wrote:

I understand that, and agree. I just think it’s time to move on from C89 :wink:

On Sat, Apr 30, 2011 at 11:21 AM, Torsten Giebl wrote:

Hello !

of course one could add that - but that’s not the point imo. SDL can use

whatever c version it wants, but should not force the users of sdl to
use a particular compiler option or c version (resp. should allow to
compile your software without warnings with -pedantic imo). and as this
header is included by SDL.h everyone using -pedantic will get these
warnings.

When it is possible, by just removing a “,” to make old compilers happy,
then we should do it. It is the same thing with /* */ and //

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Matthew Orlando
http://cogwheel.info


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org