Web lists-archives.com

Re: [Mingw-users] bizarre problem, need help from a mingw developer

On 08-Mar-2016 10:45, Keith Marshall wrote:
> On 07/03/16 21:44, mathog wrote:
>> Is the "ISO-C redundancy effect" another name for the behavior 
>> described
>> above in section of the C99 standard?
> Yes.  C99 says "%lf% is the same as "%f": the "l" modifier does 
> nothing,
> and is therefore redundant, so why does anyone use it?  It's just plain
> pointless.  However, in Microsoft parlance, "%lf" is NOT the same as
> "%f"; it is interpreted as being equivalent to "%Lf", which expects a
> long double argument, NOT a double.  Since MinGW targets a Microsoft
> platform, the current MinGW printf() implementation emulates the
> Microsoft behaviour, (and MSVC is not C99, especially when linking with
> the platform MSVCRT.DLL); thus, if you specify "%lf" format, you should
> pass a long double argument, NOT a double.

(Modified from a question by one of the devlibs guys):

Do these functions exist, and if so, what are their names?
  __mingw_printf()  the ISO-compliant version of printf()
  __msvcrt_printf() non-ISO-compliant (Microsoft) version of printf().

Is there a switch that tells the compiler to use one or the other of 
these labels,
or does the compiler only generate a common __printf() for the object 

In the latter case, if one is building a  package where some of the 
objects want one and some of the objects want the other, what tells the 
linker which to use?

The answer is far from evident since the single module test case:

   gcc -std=c99 -o printf_bug printf_bug.c

gives non C99 behavior with respect to "%lf".

Is there a list somewhere of the known differences between MSVCRT and 
the alternate mingw library?  The ones I have heard of, so far are:

    %lf  means %LF in MSVCRT
    %ll  not in MSVCRT
    %LF  64 bit vs. 80 bit argument issues

and that's just printf() issues.


David Mathog
Manager, Sequence Analysis Facility, Biology Division, Caltech

Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe