>Number:         2658
>Category:       general
>Synopsis:       Compile problem during make - similar to PR# 2605
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Jul 21 21:20:00 PDT 1998
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.3.0
>Environment:
AIX 4.1.5 (uname -a = AIX ibmf40 1 4 000042144C00)
IBM cc compiler
*Not* using DSO options for AIX
>Description:
I have a problem with building Apache 1.3.0 on AIX 4.1.5, using the IBM 'cc' 
compiler, not gcc. 
It appears in the problem report 2605, although that is about the __attribute__ 
error immediately above the problem I am 
reporting. I am reporting the "const char *" redeclaration does not match 
problem.
If I compile it with gcc it all goes fine with no errors or warnings, but 
unfortunately I have to compile it with 'cc'.
Note that I am not using the DSO options for AIX.

I get an error, which I have seen posted by other people with different aix 
versions, on the 
comp.infosystems.www.servers.unix news group, as follows:


     cc -c  -I../../os/unix -I../../include  -O2 -DAIX=41 -DNEED_RLIM_T 
-U__STR__ -qnogenpcomp 
     -qnousepco
     mp -DSTATUS -DUSE_HSREGEX `../../apaci` os.c
     "/usr/include/sys/cdefs.h", line 118.9: 1506-236 (W) Macro name 
__attribute__ has been redefined.
     "/usr/include/sys/cdefs.h", line 118.9: 1506-358 (I) "__attribute__" is 
defined on line 829 of ../..
     /include/conf.h.
     "os-aix-dso.c", line 133.12: 1506-343 (S) Redeclaration of dlerror differs 
from previous declaration
      on line 111 of "../../os/unix/os.h".
     "os-aix-dso.c", line 133.12: 1506-050 (I) Return type "unsigned char*" in 
redeclaration is not compa
     tible with the previous return type "const unsigned char*".



The error is "os-aix-dso.c" line 133.12, saying the redeclaration differs. The 
error is WRONG, 
the two lines of source are identical, as shown below:


     *** FUNCTION PROTOTYPE, LINE 133 of os-aix-dso.c ***
     const char *dlerror(void);

     *** FUNCTION DEFINITION, LINE 387 of os-aix-dso.c ***
     const char *dlerror(void)

     *** FORWARD DECLARATION, LINE 111 of os.h ***
     const char *dlerror(void);


If I remove the word "const" from each of the declarations, as so:


     *** FUNCTION PROTOTYPE, LINE 133 of os-aix-dso.c ***
     char *dlerror(void);

     *** FUNCTION DEFINITION, LINE 387 of os-aix-dso.c ***
     char *dlerror(void)

     *** FORWARD DECLARATION, LINE 111 of os.h ***
     char *dlerror(void);

Then the error will go away. For some reason ibm cc does not like 'const' in 
this context ?
The problem does not occur with gcc.
>How-To-Repeat:
- make the source in src/os/unix, with IBM cc
- follow the same steps as for #2605
>Fix:
- Remove the 'const' from the declaration. Dont know what this will do though.
- Or use gcc!
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]



Reply via email to