Article View: gnu.gcc.bug
Article #1371Warnings and %-sequences
From: Henry Flurry
Date: Wed, 11 Nov 1992 18:30
Date: Wed, 11 Nov 1992 18:30
47 lines
1774 bytes
1774 bytes
The program below generates the following warnings on NeXT's 3.0 compiler:
stuff.c: In function `main':
stuff.c:17: warning: precision and `0' flag both used in one %-sequence
stuff.c:17: warning: precision and `0' flag both used in one %-sequence
stuff.c:17: warning: precision and `0' flag both used in one %-sequence
stuff.c:17: warning: precision and `0' flag both used in one %-sequence
stuff.c:17: warning: precision and `0' flag both used in one %-sequence
a) I don't have gcc2.3. Does it make these warnings?
b) I don't understand the purpose of these warnings in my usage of the %f
sequence, although I see a potential purpose for them in a %d sequence.
Am I missing something?
c) If the warnings are valid, is there another way to code my %f sequence
so that I achieve the same results but don't get the warning? (I want a
minimum of an XX.XX field, zero padded, with the ability to have the left
side expand)
- Thanks!
- Henry Flurry
### BEGIN ###
/*
** File: stuff.c
** Compile: cc -Wall stuff.c -o stuff
** Run: stuff
*/
#include <stdio.h>
int main(void)
{
printf("%05.2f\t%05.2f\t%05.2f\t%05.2f\t%05.2f\n",
(double)1.2,
(double)12.3,
(double)192834.39,
(double)0.004,
(double)10.01);
return 0;
}
### END ###
Technical Details
Message-ID:
<9211120430.AA10175@_imagine.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!imagine.COM!henryfShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!imagine.COM!henryf From: henryf@imagine.COM (Henry Flurry) Subject: Warnings and %-sequences Message-ID: <9211120430.AA10175@_imagine.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 11 Nov 1992 18:30:10 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 49