Howdy,

I was playing around with OpenOCD's building process and I noticed the embedded HTTP server option. Firstly, I was wondering what this was for. The HTTPD option is only listed in the texi, but I couldn't find anything that talked about what it was for. Anyway, during the build I hit a warning caught as error. I've pasted the error and attached a patch that gets rid of the error. Everything seems to run afterwards, but I don't know how to test the HTTPD stuff.

Configure Options:

./configure --enable-parport --enable-amtjtagaccel --enable-ioutil --enable-httpd --enable-ft2232_libftdi --enable-presto_libftdi --enable-usbprog --enable-oocd_trace --enable-jlink --enable-vsllink --enable-rlink --enable-arm-jtag-ew --enable-dummy --enable-maintainer-mode

Build Error:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src/helper -I../../src/target -I../../src/flash -I../../src/jtag -DPKGLIBDIR=\"/usr/local/lib/openocd\" -g -O2 -Wall -Wstrict-prototypes -Wformat-security -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT libserver_la-httpd.lo -MD -MP -MF .deps/libserver_la-httpd.Tpo -c httpd.c -fPIC -DPIC -o .libs/libserver_la-httpd.o
cc1: warnings being treated as errors
httpd.c: In function ‘handle_request’:
httpd.c:310: error: format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘size_t’
httpd.c: In function ‘httpd_start’:
httpd.c:426: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type
make[3]: *** [libserver_la-httpd.lo] Error 1
make[3]: Leaving directory `/home/dnglaze/workspace/OpenOCD/src/server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/dnglaze/workspace/OpenOCD/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dnglaze/workspace/OpenOCD'
make: *** [all] Error 2
Index: src/server/httpd.c
===================================================================
--- src/server/httpd.c  (revision 1796)
+++ src/server/httpd.c  (working copy)
@@ -307,7 +307,7 @@
                        return ret;
                }
 
-               LOG_DEBUG("Serving %s length=%u", url, len);
+               LOG_DEBUG("Serving %s length=%u", url, (unsigned int) len);
                /* serve file directly */
                response = MHD_create_response_from_data(len, data, MHD_YES, 
MHD_NO);
                MHD_add_response_header(response, "Content-Type", "image/png");
@@ -322,7 +322,7 @@
 
 static int ahc_echo(void * cls, struct MHD_Connection * connection,
                const char * url, const char * method, const char * version,
-               const char * upload_data, unsigned int * upload_data_size, void 
** ptr)
+               const char * upload_data, size_t * upload_data_size, void ** 
ptr)
 {
        int post = 0;
 
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to