This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc 2.95.2, spurious warning on "%Lf"


The following test source file (long_double_test.c):
========================================================================
extern int printf(const char *, ...);

void long_double_test(void)
{
    long double x = 42.0;
    printf("x = %Lf\n", x);
}
========================================================================

produces the following incorrect diagnostic message:
========================================================================
long_double_test.c: In function `long_double_test':
long_double_test.c:7: warning: ANSI C does not support the `L' length modifier
========================================================================

The command line used was:
    gcc -c -ansi -pedantic -Wall long_double_test.c

"gcc --version" says
    2.95.2

"uname -a" says
    SunOS elmak 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-60

The current C standard, ANSI/ISO 9899-1990, includes type long double
(see 6.1.2.5), and in the section on fprintf refers to "an optional
L specifying that a following e, E, f, g, or G conversion specifier
applies to a long double argument" (7.9.6.1).

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
"Oh my gosh!  You are SO ahead of your time!" -- anon.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]