From apwww@hyperreal.org Thu Jul 31 21:34:15 1997 Received: (from apwww@localhost) by hyperreal.org (8.8.5/8.8.5) id VAA16472; Thu, 31 Jul 1997 21:34:15 -0700 (PDT) Message-Id: <199708010434.VAA16472@hyperreal.org> Date: Thu, 31 Jul 1997 21:34:15 -0700 (PDT) From: Richard Tomkins Reply-To: rtt@synapse.net To: apbugs@hyperreal.org Subject: alloc.c and mod_dir.c have problems with incompatible pointer type assignment X-Send-Pr-Version: 3.2 >Number: 958 >Category: os-ultrix >Synopsis: alloc.c and mod_dir.c have problems with incompatible pointer type assignment >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Thu Jul 31 21:40:01 1997 >Last-Modified: Sat Feb 14 04:45:31 PST 1998 >Originator: rtt@synapse.net >Organization: >Release: 1.2.1 >Environment: DECstation 3100, fresh install of ULTRIX V4.5 and C and C++ compilers. >Description: # Configure Using config file: Configuration Using Makefile template file: Makefile.tmpl + configured for ULTRIX platform + setting C compiler to cc + setting C compiler optimization-level to -O2 # make (cd regex; make lib CC=cc AUX_CFLAGS='-O2 -DULTRIX -std ' RANLIB='ranlib') rm -f *.o sh ./mkh -i _REGEX_H_ regex2.h regcomp.c regerror.c regexec.c regfree.c >regexp cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h rm -f regex.tmp sh ./mkh -p regcomp.c >regcomp.ih cc -I. -DPOSIX_MISTAKE -O2 -DULTRIX -std -c regcomp.c sh ./mkh -p engine.c >engine.ih cc -I. -DPOSIX_MISTAKE -O2 -DULTRIX -std -c regexec.c sh ./mkh -p regerror.c >regerror.ih cc -I. -DPOSIX_MISTAKE -O2 -DULTRIX -std -c regerror.c cc -I. -DPOSIX_MISTAKE -O2 -DULTRIX -std -c regfree.c rm -f libregex.a ar crv libregex.a regcomp.o regexec.o regerror.o regfree.o a - regcomp.o a - regexec.o a - regerror.o a - regfree.o ranlib libregex.a cc -c -Iregex -O2 -DULTRIX -std alloc.c cfe: Warning: alloc.c, line 852: Incompatible pointer type assignment fd = fdopen(desc, mode); ------------------------^ cfe: Warning: alloc.c, line 868: Incompatible pointer type assignment f=fdopen(fd,mode); --------------^ cc -c -Iregex -O2 -DULTRIX -std http_main.c cc -c -Iregex -O2 -DULTRIX -std http_core.c cc -c -Iregex -O2 -DULTRIX -std http_config.c cc -c -Iregex -O2 -DULTRIX -std http_request.c cc -c -Iregex -O2 -DULTRIX -std http_log.c cc -c -Iregex -O2 -DULTRIX -std http_protocol.c cc -c -Iregex -O2 -DULTRIX -std rfc1413.c cc -c -Iregex -O2 -DULTRIX -std util.c cc -c -Iregex -O2 -DULTRIX -std util_script.c cc -c -Iregex -O2 -DULTRIX -std modules.c cc -c -Iregex -O2 -DULTRIX -std buff.c cc -c -Iregex -O2 -DULTRIX -std md5c.c cc -c -Iregex -O2 -DULTRIX -std util_md5.c cc -c -Iregex -O2 -DULTRIX -std explain.c cc -c -Iregex -O2 -DULTRIX -std http_bprintf.c cfe: Warning: http_bprintf.c, line 91: Long double not supported; double assume. long double lDoubleArg = 0.0; ----^ cc -c -Iregex -O2 -DULTRIX -std util_date.c cc -c -Iregex -O2 -DULTRIX -std util_snprintf.c cc -c -Iregex -O2 -DULTRIX -std mod_env.c cc -c -Iregex -O2 -DULTRIX -std mod_log_config.c cc -c -Iregex -O2 -DULTRIX -std mod_mime.c cc -c -Iregex -O2 -DULTRIX -std mod_negotiation.c cc -c -Iregex -O2 -DULTRIX -std mod_include.c cc -c -Iregex -O2 -DULTRIX -std mod_dir.c cfe: Warning: mod_dir.c, line 772: Incompatible pointer type assignment (int (*))dsortf); ------^ cc -c -Iregex -O2 -DULTRIX -std mod_cgi.c cc -c -Iregex -O2 -DULTRIX -std mod_asis.c cc -c -Iregex -O2 -DULTRIX -std mod_imap.c cc -c -Iregex -O2 -DULTRIX -std mod_actions.c cc -c -Iregex -O2 -DULTRIX -std mod_userdir.c cc -c -Iregex -O2 -DULTRIX -std mod_alias.c cc -c -Iregex -O2 -DULTRIX -std mod_access.c cc -c -Iregex -O2 -DULTRIX -std mod_auth.c cc -c -Iregex -O2 -DULTRIX -std mod_browser.c cc -o httpd alloc.o http_main.o http_core.o http_config.o http_request.o ht # >How-To-Repeat: make the same setup. >Fix: I modified alloc.c by changing the initialization of FILE fd* = NULL; to just FILE *fd; I typecast the mode parameter to const char * on the two fdopen lines. In mod_dir.c I commented out the ULTRIX_BRAIN_DEATH compile time #if to use the second version which matched my C documentation. I left the http_bprinf.c problem as it seemed harmless at the time >Audit-Trail: From: Dean Gaudet To: Richard Tomkins Subject: Re: os-ultrix/958: alloc.c and mod_dir.c have problems with incompatible pointer type assignment Date: Thu, 31 Jul 1997 21:52:38 -0700 (PDT) On Thu, 31 Jul 1997, Richard Tomkins wrote: > cfe: Warning: alloc.c, line 852: Incompatible pointer type assignment > fd = fdopen(desc, mode); > ------------------------^ > cfe: Warning: alloc.c, line 868: Incompatible pointer type assignment > f=fdopen(fd,mode); > --------------^ You say you cast mode to (const char *)... but that's exactly what it's prototyped as. No cast should be necessary: FILE *pfopen(pool *a, const char *name, const char *mode); Oh I know what's up. conf.h is doing "#define const" ... which is probably wrong for more recent versions of ultrix. > cfe: Warning: http_bprintf.c, line 91: Long double not supported; double assume. > long double lDoubleArg = 0.0; > ----^ Yeah nothing worth worrying about. > cfe: Warning: mod_dir.c, line 772: Incompatible pointer type assignment > (int (*))dsortf); > ------^ That's a pretty lame cast we do there. (int (*)) is a (int *), not an (int (*)()) None of this is fatal though, just generates warnings. Dean State-Changed-From-To: open-analyzed State-Changed-By: dgaudet State-Changed-When: Thu Sep 25 00:12:20 PDT 1997 State-Changed-Why: We need to know what version of ultrix it's safe to use const on ... at least that is probably what the problem is. This isn't critical at any rate, it doesn't affect the correctness of the code. Dean Severity-Changed-From-To: critical-non-critical Severity-Changed-By: dgaudet Severity-Changed-When: Thu Sep 25 00:12:20 PDT 1997 State-Changed-From-To: analyzed-closed State-Changed-By: dgaudet State-Changed-When: Sat Feb 14 04:45:31 PST 1998 State-Changed-Why: Without access to various ultrix platforms it'll be hard to eliminate the warnings reliably. So for now we'll just have to live with them. Dean >Unformatted: