[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "discards qualifiers from pointer target type" in ltdl.c

From: Ralf Wildenhues
Subject: Re: "discards qualifiers from pointer target type" in ltdl.c
Date: Thu, 18 Aug 2005 10:55:28 +0200
User-agent: Mutt/1.4.1i

Hi Stefaan,

* Stefaan wrote on Thu, Aug 18, 2005 at 09:16:33AM CEST:
> I don't know how bad you want compiler warnings fixed,

Only if a clean fix is possible, fixes it on all kinds of compilers
while not introducing new warnings (or failures!  Yes, I've managed
to do that once!) on others, and rather not for branch-1-5.  Of course,
warnings that show actual bugs are a different matter altogether.

> but since
> packages seem to copy this source file I'm inclined to report it: (I
> bumped into this trying to eliminate warnings out of "kaffe")
> ltdl/ltdl.c contains a function strrchr with declaration (line 346)
> static const char *strrchr LT_PARAMS((const char *str, int ch));
> of which the result is then afterwards at more then one occasion used
> for a "char *" variable.  At line 2757 there even is an explicit
> assignment to the resulting char.  (All line numbers are for latest
> CVS)

You mean branch-1-5, right?

> Personally, I think the function declaration and definition can just
> be changed to used "char *" instead of "const char *".

Surely.  Then you'll have the warning within the strrchr replacement
implementation.  SUSv3 specifies it with "char *" as you suggest.

It is virtually impossible to write nontrivial system-dependent code
without warnings.  Whether, in a case of a tie (either compiler X or
compiler Y warns), we should go for the most-used compiler and system,
might be a worthwhile question just to keep the number of bug reports
lower.  Other than that, I don't care much myself.

Cheers, and thanks for reporting,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]