🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Henry Flurry Wed, 11 Nov 1992 18:30
Warnings and %-sequences
#1371
Author: Henry Flurry
Date: Wed, 11 Nov 1992 18:30
47 lines
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 ###
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads