httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <>
Subject Re: cvs commit: apache-1.3/src/os/unix os.c
Date Sun, 19 Apr 1998 16:23:20 GMT
Ralf S. Engelschall wrote:
> In article <> you
> > Is there any advantage to not just casting it for all platforms?
> > I think that if you think OSF1 and FreeBSD will be the only platforms that
> > do this, you will be quite mistaken, and having long lists of OSes in code
> > isn't nice when it isn't necessayr.
> Hmmm.... I don't know if it isn't necessary to cast always. What is ANSI C's
> rule here: When I have a "const char *" and pass this to a function which
> wants a "char *", the cast is needed or the compiler complains with
> "discarding char". Ok. And on the other hand? When I've a "const char *" and
> the function wants a "const char *" but I cast with "char *". Is this always
> ok this way around? I'm not sure. Definitive comments?

Yes, it is always OK to add a const. Removing one isn't. OTOH, casting
for all platforms is bad, if you don't have to, coz one day it'll bite

Anyway, why does dlopen() not have const? Is it actually going to change
the string?



Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|
and Technical Director|Email: |
A.L. Digital Ltd,     |Apache-SSL author
London, England.      |"Apache: TDG"

View raw message