Man I couldn't stop laughing when I activated the -pedantic flag in MinGW and it gave me an error in the Allegro library, and I was like uh? what could it be? And when I saw the error...
typedef enum ALLEGRO_FILE_MODE { ALLEGRO_FILEMODE_READ = 1, ALLEGRO_FILEMODE_WRITE = 1 << 1, ALLEGRO_FILEMODE_EXECUTE = 1 << 2, ALLEGRO_FILEMODE_HIDDEN = 1 << 3, ALLEGRO_FILEMODE_ISFILE = 1 << 4, ALLEGRO_FILEMODE_ISDIR = 1 << 5, // < -- This?... My god... } ALLEGRO_FILE_MODE;
4.6.2\include\allegro5\fshook.h|52|error: comma at end of enumerator list [-pedantic]|
Hahahahaha Why the compiler is so strict sometimes and sometimes is not?
-pedantic really means what it says it means. It's there to be pedantic. Now add -ansi to the argument list and see how much it screams.
Uh? it didn't gave me any errors with -ansi are you pulling my leg?
Uh? it didn't gave me any errors with -ansi are you pulling my leg?
That probably just means we've done a decent job with Allegro
-ansi and -pedantic together usually lead to a lot of warnings and errors for projects. You are adding -Wall -Wextra right?
You are adding -Wall -Wextra right?
No I had only -Wall, I have just added -Wextra but it's the same. Man why my compiler doesn't give me any errors? I want compilers errors.
When I made the trivia game I didn't use none of this, and even not using them I had some warnings about variables being initialized first in the initialization list and problems with char and int being compared, but this time I want to let it everything crystal clear, since the project is going to be a lot bigger.
My next videogame...
Yay \o/
No I had only -Wall, I have just added -Wextra but it's the same. Man why my compiler doesn't give me any errors? I want compilers errors.
Write worse code.
Fixed, thanks.
Well I just put it here to let you know... There is another comma out there! be careful you can blow out your PC!
enum ALLEGRO_MIXER_QUALITY { ALLEGRO_MIXER_QUALITY_POINT = 0x110, ALLEGRO_MIXER_QUALITY_LINEAR = 0x111, };
Allegro_audio.h
I'm finding this while including the headers in my project... hoHOho.
From the zlib FAQ (q 35)
"Q: I get this or that compiler or source-code scanner warning when I crank it up to maximally-pedantic. Can't you guys write proper code?
A: Many years ago, we gave up attempting to avoid warnings on every compiler in the universe. It just got to be a waste of time, and some compilers were downright silly. So now, we simply make sure that the code always works."
They can say whatever they want, but if I find another comma out of place I will stop using Allegro, and that is my last word...
There should be a for(;;) loop in there somewhere, and Wednesday's and Sunday's values are totally unacceptable.
if I find another comma out of place I will stop using Allegro
There were two more.
Anyway, it's worth fixing these things in public headers because you never know where they will be included.
For consistency you need to keep all the numbers the same length:
Are you forgetting that starting a number with a zero (but no x) means the compiler interprets it as octal?
No, that's exactly why I 'corrected' the code