www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - b64 compile error: printf() format warning

reply mis232 <mis232 mis232.com> writes:
gcc -D_DEBUG -UNDEBUG   -c -Wall -pedantic -Wno-long-long -Wno-unused-value
-Wundef -Wshadow -Werror  -Dunix -DB64_NO_IMPLICIT_LINK   -I../../include   -o
example.c.2.debug.o ../../examples/c/example.c.2/example.c.2.c
cc1: warnings being treated as errors
../../examples/c/example.c.2/example.c.2.c: In function ‘main’:
../../examples/c/example.c.2/example.c.2.c:110: warning: format ‘%d’ expects
type ‘int’, but argument 4 has type ‘long int’

Changing line 110 to following fixes it problem

fprintf(stderr, "decoding error %u at character %ld: %s\n", rc, badChar - enc,
badChar);
Jul 22 2008
parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
Thanks. This is now fixed; see
http://www.digitalmars.com/webnews/newsgroups.php?art_group=c%2B%2B.stlsoft&article_id=1616

"mis232" <mis232 mis232.com> wrote in message
news:g646sc$mkf$1 digitalmars.com...

-I../../include -o example.c.2.debug.o ../../examples/c/example.c.2/example.c.2.c
 cc1: warnings being treated as errors
 ../../examples/c/example.c.2/example.c.2.c: In function 'main':
 ../../examples/c/example.c.2/example.c.2.c:110: warning: format '%d' expects
type 'int', but argument 4 has type 'long int'

 Changing line 110 to following fixes it problem

 fprintf(stderr, "decoding error %u at character %ld: %s\n", rc, badChar - enc,
badChar);

Aug 02 2008