This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc 2.95.2, spurious warning on "%Lf"
- To: bug-gcc at gnu dot org
- Subject: gcc 2.95.2, spurious warning on "%Lf"
- From: kst at cts dot com (Keith Thompson)
- Date: Fri, 17 Dec 1999 19:44:30 -0800 (PST)
- Cc: kst at cts dot com (Keith Thompson)
- Organization: Yeah, right
- Reply-To: kst at cts dot com
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.