A null char. As I mentioned in the commit message to deal with this, I'm not quite sure why I went through such pains to store a null character and couldn't just use NULL or (char) 0 in the code where it was needed.
All I remember is some foggy issue with wide characters on win32, but I don't remember exactly what (and no longer have the original development environment for it) In any case, it passes on maintainer mode now, and I hope to get a testbed up for win32/vc6 and win32/vc9 (bill, if you're listening, do you generally test against vc8 or vc9?), and maybe even sparc solaris 10, sunstudio 12 (if I can figure out how to set that up in the next few days - I need such a compilation environment for work anyway, so may as well test out new features there :)) Sorry for the messy commit :-/ Issac PS, a basic test of the patch is running modules/test_cgi after make test. If someone can think of a clever way to test this (which needs stdin input) from Test::More, Apache::Test and friends, I can try to get better unit-testing in place, too Joe Schaefer wrote: > After this commit all I'm left with is the following issue > that prevents compilation on my machine: > > % make > ... > gcc -DHAVE_CONFIG_H -I. -I. -I../include > -I/home/joe/httpd/trunk/prefork/include/apr-1 -DLINUX=2 -D_REENTRANT > -D_GNU_SOURCE -g -O2 -fno-strict-aliasing -Werror -Wall -Wmissing-prototypes > -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -Wcast-qual > -Wfloat-equal -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare > -Waggregate-return -Wmissing-noreturn -Wmissing-format-attribute -Wpacked > -Wredundant-decls -Wnested-externs -Wdisabled-optimization -Wno-long-long > -Wendif-labels -Wcast-align -c module_cgi.c -MT module_cgi.lo -MD -MP -MF > .deps/module_cgi.TPlo -fPIC -DPIC -o .libs/module_cgi.o > cc1: warnings being treated as errors > module_cgi.c: In function 'apreq_handle_cgi': > module_cgi.c:1005: warning: reading through null pointer (argument 3) > module_cgi.c:1005: warning: format '%s' expects type 'char *', but argument 3 > has type 'void *' > make[2]: *** [module_cgi.lo] Error 1 > > > line 1005 has: sprintf(buf, "%s", NULL); > > which can't be right, can it? What do you really > want to write to buf, Issac? > > > > > ----- Original Message ---- > >> From: "j...@apache.org" <j...@apache.org> >> To: apreq-...@httpd.apache.org >> Sent: Tuesday, January 13, 2009 3:31:53 PM >> Subject: svn commit: r734232 - /httpd/apreq/trunk/library/module_cgi.c >> >> Author: joes >> Date: Tue Jan 13 12:31:48 2009 >> New Revision: 734232 >> >> URL: http://svn.apache.org/viewvc?rev=734232&view=rev >> Log: >> more gcc warnings evaded >> >> Modified: >> httpd/apreq/trunk/library/module_cgi.c >> >> Modified: httpd/apreq/trunk/library/module_cgi.c >> URL: >> http://svn.apache.org/viewvc/httpd/apreq/trunk/library/module_cgi.c?rev=734232&r1=734231&r2=734232&view=diff >> ============================================================================== >> --- httpd/apreq/trunk/library/module_cgi.c (original) >> +++ httpd/apreq/trunk/library/module_cgi.c Tue Jan 13 12:31:48 2009 >> @@ -230,7 +230,7 @@ >> } >> case '\\': /* Check next character for escape sequence >> * (just ignore it for now) */ >> - *cprompt++; >> + (void)*cprompt++; >> /* Fallthrough */ >> >> default: >> @@ -243,7 +243,7 @@ >> apr_file_printf(req->sout, "%s", buf[0]); >> apr_file_gets(buf[0], MAX_BUFFER_SIZE, req->sin); >> chomp(buf[0]); >> - if (stricmp(buf[0], "")) { >> + if (strcmp(buf[0], "")) { >> /* if (strcmp(buf[0], nullstr)) */ >> return apr_pstrdup(handle->pool, buf[0]); >> /* return NULL; */ >> @@ -597,7 +597,7 @@ >> else >> t = req->jar; >> >> - val = (char *)apr_table_get(t, name); >> + val = apr_table_get(t, name); >> if (val == NULL) { >> if (!req->interactive_mode) { >> return NULL; >> > > > > >