On Sun, Sep 20, 2009 at 11:52 AM, Kai Tietz <ktiet...@googlemail.com> wrote:
> To solve those kind of issues inttypes.h is there, and is btw also
> adjusted by our header-set when __USE_MINGW_ANSI_STDIO is defined. A
> mix mode between platform M$ printf formats and gnu'ish one is in
> general a bad idea.
>
> Kai
>

Should I commit this then:

Index: _mingw.h
===================================================================
--- _mingw.h    (revision 1397)
+++ _mingw.h    (working copy)
@@ -441,20 +441,10 @@
 #define _TRUNCATE ((size_t)-1)
 #endif

-#ifndef __USE_MINGW_ANSI_STDIO
-/* If user didn't specify it explicitly... */
-# if defined(__STRICT_ANSI__) || defined(_ISOC99_SOURCE)       \
-    || defined(_POSIX)                                         \
-    || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)      \
-    || defined(_XOPEN_SOURCE) || defined(_XOPEN_SOURCE_EXTENDED)\
-    || defined(_GNU_SOURCE)   || defined(_BSD_SOURCE)          \
-    || defined(_SVID_SOURCE)
-   /*
-    * but where any of these source code qualifiers are specified,
-    * then assume ANSI I/O standards are preferred over Microsoft's...
-    */
+#if defined(_POSIX) && !defined(__USE_MINGW_ANSI_STDIO)
+/* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
+ * and If user did _not_ specify it explicitly... */
 #  define __USE_MINGW_ANSI_STDIO                       1
-# endif
 #endif


--
Ozkan


> 2009/9/20 Kai Tietz <ktiet...@googlemail.com>:
>> 2009/9/20 Ozkan Sezer <seze...@gmail.com>:
>>> On Sun, Sep 20, 2009 at 2:55 AM, Erik de Castro Lopo
>>> <mle+...@mega-nerd.com> wrote:
>>>>
>>>> Please note, I am subscribed to the list. No need to CC me on reply.
>>>>
>>>> Ozkan Sezer wrote:
>>>>
>>>>> A question, though: Are you using gcc-3.4.5 or 4.4.0 as the mingw.org
>>>>> compiler for your w32 builds?  I think the warning may be a gcc-4.4+
>>>>> thing and not actually a mingw-w64 issue, but I don't know for sure.
>>>>
>>>> Now that I've checked, it seems a little more complicated than I first
>>>> thought.
>>>>
>>>> The mingw32 compiler that I'm using is the one from the Ubuntu 9.04
>>>> mingw32 package. It reports its version as:
>>>>
>>>>    gcc version 4.2.1-sjlj (mingw32-2)
>>>>
>>>> This compiler JustWorks(tm) and accepts '%zd" in printf/snprintf as well
>>>> as the other C99 format string stuff.
>>>>
>>>
>>> OK, looked at the mingw.org phovided gcc4.2.1-2 source
>>> and they add windows specific format specifiers like %I32
>>> in gcc/config/i386/mingw32.h but with a note like:
>>>
>>> /* MSVCRT supports additional length specifiers for "printf".  (In
>>>   fact, it does not support some of the C99 specifiers, like
>>>   "ll".  However, we do not presently have a mechanism for disabling
>>>   a specifier.)  */
>>>
>>> 4.4 was the version that ms-printf format support officially
>>> went into gcc along with mechanisms catching what is OK
>>> and what is not.
>>>
>>> A note out of curiosity: Does your versions compiled by
>>> gcc < 4.4 of mingw.org give correct output ?
>>>
>>>> The mingw32 package on Debian Sid is:
>>>>
>>>>    gcc version 4.4.1 (GCC)
>>>>
>>>> and it too gives a warning on both c99 and gnu99.  For this compiler,
>>>> not even -D__USE_MINGW_ANSI_STDIO=1 can fix it.
>>>>
>>>> Me, I'd just like to compile the one piece of source code on as many 
>>>> systems
>>>> as possible without hacking it to bits with  #ifdefs. I'd  also like,
>>>> where possible, to get the compiler using apt-get, instead of compling it
>>>> myself.
>>>>
>>>> Erik
>>>> --
>>>> ----------------------------------------------------------------------
>>>> Erik de Castro Lopo
>>>> http://www.mega-nerd.com/
>>>>
>>>
>>> --
>>> Ozkan
>>>
>>
>> As mingw.org doesn't use any printf formatter rules for their
>> redirected functions (which is IMHO a bug), they don't get warnings
>> for anything passed into this functions.
>> IMHO as more as I think about this feature, it should be turned on on
>> user demand by defining __USE_MINGW_ANSI_STDIO explicit. To turn it on
>> for some cX9 standards, or for __GNU_SOURCE, etc is misleading and a
>> mis-concept. We can automatically turn it on, if _POSIX is defined,
>> but the rest is just buggy.
>>
>> Cheers,
>> Kai

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to