On 1/14/2012 18:55, Kai Tietz wrote:
> 2012/1/14 JonY <[email protected]>:
>> On 1/14/2012 17:08, Kai Tietz wrote:
>>>
>>> JonY,
>>>
>>> I don't see any need in decorating default-printf/scanf-family names
>>> by those macros.  They getting those default-styles by compiler itself
>>> and it isn't of any interest to write it explict here.
>>>
>>> Kai
>>
>> OK, I noted something interesting anyway:
>>
>> This produces no warning, gets printf wrapper to ___mingw_vprintf.
>> echo 'int main(){printf("%llu\n",0ull); return 0;}'|i686-w64-mingw32-gcc
>> -xc++ -Wall -Wformat -include stdio.h -D__USE_MINGW_ANSI_STDIO=1 -O0 -
>> -s -S -o- -fno-builtin
>>
>> This makes a warning, assembly code similar.
>> echo 'int main(){printf("%llu\n",0ull); return 0;}'|i686-w64-mingw32-gcc
>> -xc++ -Wall -Wformat -include stdio.h -D__USE_MINGW_ANSI_STDIO=1 -O0 -
>> -s -S -o-
>>
>> No warnings for both if using -xc, maybe its my odd setup.
> 
> Yes, because testcase is invalid.  POSIX-printf gets activated if
> header is included.  By default msvcrt's printf is used.  So add
> #include <stdio.h> to make testcase valid.
> 

It is already included with -include stdio.h, it even generated a
wrapper to ___mingw_vprintf. Clearly, the overrides in the header has
taken effect. Besides, if the include was missing, -xc++ shouldn't be
able to build. I even tested my adding the defines into stdio.h itself.

>> Btw, why are some of the msvcrt prototypes not declared with _CRTIMP anyway?
> 
> See headers, see libmingwex.a implementation and this question is answered.
> 
> Kai

For default printf, the comment says "Default configuration: simply
direct all calls to MSVCRT...".

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to