when you do printf("%*d", num, 16); it's supposed to print a 128-byte integer 
(such as an __int128?).
current definition is not implemented properly.  in fact, a 3-byte integer 
should also be handled, as in the case of a color:
printf("%*u", rgb, 3);
or for larger numbers
printf("%*u", num, 40); //just wondering if you can use an array of integers 
with this.  haven't looked at the source in a while. would be super cool if you 
could.  but I guess that would be GMP wouldn't it...






>________________________________
>From: Ozkan Sezer <seze...@gmail.com>
>To: mingw-w64-public@lists.sourceforge.net
>Sent: Wednesday, September 28, 2011 10:38 PM
>Subject: Re: [Mingw-w64-public] [PATCH] better *printf *scanf definitions
>
>On Thu, Sep 29, 2011 at 4:08 AM, Rafaël Carré <fun...@videolan.org> wrote:
>> Hi,
>>
>> Current CPP definitions for *printf and *scanf
>> (with__USE_MINGW_ANSI_STDIO >= 0) in
>> mingw-w64-headers/crt/_mingw_print_pop.h are too invasive.
>>
>> Example:
>> myfile.h:189:47:
>> warning: '__mingw_printf' is an unrecognized format function type
>> [-Wformat]
>>
>> when preprocessing "void func(const char *format, ...)
>> __attribute__((printf(format, 1, 2)));
>
>That's why many people recommends using attribute names
>with two underscores prepended and appended, like:
>
>void func(const char *format, ...) __attribute__((__printf__(__format__,1,2)));
>
>For this part, the patch is not needed
>
>>
>> This also breaks C++ objects using members named after the standard
>> functions, like:
>>
>> class A {
>> public:
>>        QString    &sprintf(const char *format, ...)
>> };
>
>Don't know about this one though.
>
>>
>> like seen in Qt4
>>
>>
>> Attached patch use GCC variadic macros (using the GNU extension and not
>> the C99 feature, to keep compatibility with previous versions of the C
>> standard) to fix these problems. See
>> http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html for more details.
>>
>>
>> HOWEVER
>>
>> The attached patch doesn't fix completely the C++ case, if
>> standard functions are redefined inside a class with a different number
>> of arguments.
>>
>> For example QString (of qt4) class redefines sprintf without the
>> "char *str" argument, because it is assumed that the first argument
>> points to the class instance.
>>
>> It seems that mingw32 solved that in a different way, apparently by
>> using adding different prototypes with 
>> __attribute__((alias("__mingw_printf")))
>>
>> So I'm just opening the thread and will post another patch tomorrow.
>>
>> --
>> Rafaël Carré
>
>--
>O.S.
>
>------------------------------------------------------------------------------
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.
>http://p.sf.net/sfu/splunk-d2dcopy1
>_______________________________________________
>Mingw-w64-public mailing list
>Mingw-w64-public@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to