bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need warning number's list !!!! URGENT !!!!!!!!!


From: Günter Neiß
Subject: Re: need warning number's list !!!! URGENT !!!!!!!!!
Date: Thu, 25 Jan 2001 10:59:48 +0100

Artak Avetyan schrieb:

> I need the list of warnings. Need to disable some warnings. How can I
> find info. In my project I already have about 50 stupid warnings,  which
> is not connected with my codes (they come from Standard Header Files),
> it disturbs me when I look for errors.
> For example in a sample :
> 
> #include <stdio.h>
> int main(int argc, char *argv[])
> {
>  char szBuffer[256];
>  long num = 10;
>  sprintf(szBuffer, "the Number is %d.\n", num);
>  fwrite(szBuffer, 1, (long)strlen(szBuffer), stdout);
>  return 0;
> }
> 
> I receive following messages:
> 
> c++ -DHAVE_CONFIG_H -I. -I. -I..     -O0 -g3 -Wall -c main.cpp
> main.cpp: In function `int main(int, char **)':
> main.cpp:32: warning: int format, long int arg (arg 3)
> *** success ***
 
Don't try to disable it !
Fix it ! (Because it's realy an error in this case! )

Your line should look:
sprintf(szBuffer, "the Number is %ld.\n", num);
                                  ~

If Your format was a little bit more complex You will get some serious
results otherwise

Günter

Attachment: smime.p7s
Description: Kryptographische Unterschrift mit S/MIME


reply via email to

[Prev in Thread] Current Thread [Next in Thread]