Skip to contentSkip to conversation

mingw: Do not perform string format checks

PATCH In review Jan Kiszka 5 participants 10 messages Jun 14, 2009 – Jun 15, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 mingw: Do not perform string format checks

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

---

 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
configure +1 -0
index 85bc598..aa586bd 100755
@@ -223,6 +223,7 @@ audio_possible_drivers="sdl"
 ;;
 MINGW32*)
 mingw32="yes"
+OS_CFLAGS="-Wno-format"
 if [ "$cpu" = "i386" ] ; then
     kqemu="yes"
 fi
#1 lore raw
Quoted 5 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

author
#2 lore raw
Quoted 11 lines · Blue Swirl
Quoted 5 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

Jan

#3 lore raw
Quoted 13 lines · Jan Kiszka
Quoted 11 lines · Blue Swirl
Quoted 5 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

Quoted 5 lines

i686-pc-mingw32-gcc (GCC) 4.3.3

Jan

JFYI, for years there was a mingw32 patch for the format strings that

wasn't merged into the mainline gcc. It was in the MinGW patches for at least 4 years. Not sure if it was merged now or not..
Best regards,
Filip Navara

author
#4 lore raw
Quoted 15 lines · Filip Navara
Quoted 13 lines · Jan Kiszka
Quoted 10 lines · Blue Swirl
Quoted 5 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

Quoted 8 lines
Quoted 3 lines

Jan

JFYI, for years there was a mingw32 patch for the format strings that

wasn't merged into the mainline gcc. It was in the MinGW patches for at least 4 years. Not sure if it was merged now or not..
Best regards,
Filip Navara

Yes, I've seen the patch while looking for the reason, but I didn't read that it is part of mingw's gcc version. Obviously, this toolchain does not contain it. Don't know where it was derived from (hmm, mingw is still "testing" gcc4...). I just picked what was there (for OpenSUSE) to include a simple win32 build run in future patch development.

Well, if everyone else out there has I64 support, then I can also add this switch to my --extra-cflags.

Jan

#5 lore raw
In reply to Jan Kiszka

Hi,

Quoted 8 lines · Jan Kiszka
Quoted 7 lines · Blue Swirl
Quoted 5 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

Quoted 6 lines
Quoted 4 lines

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

4.3.3 is known to show this bad behavior. AFAICT it is fixed in 4.4.0. (At least it fixed things for msysGit.)

FWIW by "bad behavior" I mean that a compiler warning is emitted when using %I64, but not when using %ll. But when executing the program, it actually _requires_ a %I64, _not_ a %ll.

In light of this, I _strongly_ recommend updating to 4.4.0.

Ciao,
Dscho

author
#6 lore raw
Quoted 17 lines · Johannes Schindelin

Hi,

Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Blue Swirl
Quoted 2 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

Quoted 8 lines

4.3.3 is known to show this bad behavior. AFAICT it is fixed in 4.4.0. (At least it fixed things for msysGit.)

FWIW by "bad behavior" I mean that a compiler warning is emitted when using %I64, but not when using %ll. But when executing the program, it actually _requires_ a %I64, _not_ a %ll.

In light of this, I _strongly_ recommend updating to 4.4.0.

I will, once I come across a pre-built one that fits. For now I'll carry the -Wno-format as extra flags. The toolchain performs nicely otherwise.

Thanks,
Jan

#7 lore raw
Quoted 26 lines · Jan Kiszka
Quoted 24 lines · Johannes Schindelin

Hi,

Quoted 10 lines · Jan Kiszka
Quoted 8 lines · Blue Swirl
Quoted 6 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

Quoted 7 lines
Quoted 5 lines

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

4.3.3 is known to show this bad behavior. AFAICT it is fixed in 4.4.0. (At least it fixed things for msysGit.)

Quoted 8 lines
Quoted 4 lines

FWIW by "bad behavior" I mean that a compiler warning is emitted when using %I64, but not when using %ll. But when executing the program, it actually _requires_ a %I64, _not_ a %ll.

In light of this, I _strongly_ recommend updating to 4.4.0.

I will, once I come across a pre-built one that fits. For now I'll carry the -Wno-format as extra flags. The toolchain performs nicely otherwise.

If we're on mingw, and you run a test case with -Werror that fails because of broken I64, we could automatically add -Wno-format.

It'll help us get closer to -Werror on mingw.

Regards,

Anthony Liguori

#8 lore raw
In reply to Jan Kiszka

Hi,

Quoted 21 lines · Jan Kiszka
Quoted 20 lines · Johannes Schindelin

Hi,

Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Blue Swirl
Quoted 2 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

4.3.3 is known to show this bad behavior. AFAICT it is fixed in 4.4.0. (At least it fixed things for msysGit.)

Quoted 7 lines
Quoted 5 lines

FWIW by "bad behavior" I mean that a compiler warning is emitted when using %I64, but not when using %ll. But when executing the program, it actually _requires_ a %I64, _not_ a %ll.

In light of this, I _strongly_ recommend updating to 4.4.0.

I will, once I come across a pre-built one that fits.

The de-facto standard is http://www.tdragon.net/recentgcc/

Hth,
Dscho

author
#9 lore raw
Quoted 24 lines · Johannes Schindelin

Hi,

Quoted 20 lines · Jan Kiszka
Quoted 19 lines · Johannes Schindelin

Hi,

Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Blue Swirl
Quoted 2 lines · Jan Kiszka

[ I can't check the situation with cygwin, so this is mingw-only. ]

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

gcc still does not support the Windows-specific format string modifier "I64". Therefore, it makes no sense to check for format string correctness and generate tons of false positives.

I don't have this problem, currently mingw builds with zero warnings for me. But I didn't enable automatic -Werror flag for mingw just because I guessed this would happen. What's the gcc version you're using?

i686-pc-mingw32-gcc (GCC) 4.3.3

4.3.3 is known to show this bad behavior. AFAICT it is fixed in 4.4.0. (At least it fixed things for msysGit.)

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

FWIW by "bad behavior" I mean that a compiler warning is emitted when using %I64, but not when using %ll. But when executing the program, it actually _requires_ a %I64, _not_ a %ll.

In light of this, I _strongly_ recommend updating to 4.4.0.

I will, once I come across a pre-built one that fits.

The de-facto standard is http://www.tdragon.net/recentgcc/

This is pre-built, but for an uninteresting host platform (also known as Windows). :)

Jan