I am getting the following warning when compiling some legacy C code on Ubuntu Karmic, using gcc 4.4.1
The warning is:
src/filename.c:385: warning: '0' flag ignored with precision and ‘%i’ gnu_printf format
The snippet which causes the warning to be emitted is:
char buffer[256] ;
long fnum ;
/* some initialization code here ... */
sprintf(buffer, "F%03.3i.DTA", (int)fnum); /* <- warning emitted here */
I think I understand the warning, but I would like to check in here to see if I am right, and also the (definite) correct way of resolving this.