I'm a beginner programming student, just wanted to learn the reason behind this.
When I use this code:
#include <stdio.h>
int main()
{
double pi = 3.1415926535897932;
printf("%lf",pi);
return 0;
}
Compiler gives this warning. ISO C90 does not support the ‘%lf’ gnu_printf format [-Wformat]
I use the gcc compiler in ubuntu terminal with (-o -Wall -ansi -pedantic-errors)
What's the reason behind this? I searched web and found this use is allowed in C99. Why C90 didn't allow %lf use in printf? I can use %.16lf or %.16f and both print with the same precision, so what's the matter that makes %lf bad in C90?