Re: genshop.c error

From: Welcor (
Date: 11/21/01

----- Original Message -----
From: "Micken !" <micken69@HOTMAIL.COM>
> >Error:
> >
> >gcc -g -O2 -Wall    -c genshp.c -o genshp.o
> >genshp.c: In function `save_shops':
> >genshp.c:476: warning: int format, long int arg (arg 11)
> >
> this means, that in one of your printf's, like sprintf or fprintf, you have
> %ld as one of the arguments, but you're putting a normal int into that spot,
> meaning you have to either change it to %d or change the variable to a long
> integer.
Nope, the other way around;

sprintf(dummy_buf, "%d blah blah..", some_long_int);

Fix this by either casting the long int as int (this might not be a good idea,
since the long int might be larger than MAX_INT):

sprintf(dummy_buf, "%d blah blah..", (int)some_long_int);

or changing the format string (do it this way):

sprintf(dummy_buf, "%ld blah blah..", some_long_int);


   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST