cURL / Mailing Lists / curl-library / Single Mail

curl-library

warning during "make examples"

From: Brad Hards <bradh_at_frogmouth.net>
Date: Thu, 16 Dec 2010 20:04:26 +1100

When I build the examples, I see this:

gcc -DHAVE_CONFIG_H -I../../include/curl -I../../include -I../../include -DCURL_NO_OLDIES -g0 -O2 -Wno-system-headers -MT chkspeed.o -MD -MP -MF .deps/chkspeed.Tpo -c -o
chkspeed.o chkspeed.c
chkspeed.c: In function ‘main’:
chkspeed.c:74:11: warning: passing argument 1 of ‘strtol’ from incompatible pointer type
/usr/include/stdlib.h:184:17: note: expected ‘const char * __restrict__’ but argument is of type ‘char **’
mv -f .deps/chkspeed.Tpo .deps/chkspeed.Po
/bin/sh ../../libtool --tag=CC --mode=link gcc -g0 -O2 -Wno-system-headers -o chkspeed chkspeed.o ../../lib/libcurl.la
libtool: link: gcc -g0 -O2 -Wno-system-headers -o .libs/chkspeed chkspeed.o ../../lib/.libs/libcurl.so -lrt -lssl -lcrypto -ldl -lz -Wl,-rpath -Wl,/usr/local/lib

Is this what was meant?
diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c
index 00db5bf..4305bde 100644
--- a/docs/examples/chkspeed.c
+++ b/docs/examples/chkspeed.c
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
         } else if (strncasecmp(*argv, "-T", 2) == 0) {
           prttime = 1;
         } else if (strncasecmp(*argv, "-M=", 3) == 0) {
- long m = strtol(argv+3, NULL, 10);
+ long m = strtol((*argv)+3, NULL, 10);
           switch(m) {
             case 1: url = URL_1M;
                       break;

(I recognise the brackets are redundant, but I think it is
clearer with them).

Brad
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-16