DragonFly BSD
DragonFly submit List (threaded) for 2005-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Patch to execve


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Mon, 28 Feb 2005 14:27:46 +0100
Mail-followup-to: submit@crater.dragonflybsd.org

On Sun, Feb 27, 2005 at 03:45:39PM -0800, Kevin M. Kilbride wrote:
> The documentation for the compiler actually points out the problem with 
> the write-strings option:
> 
> "These warnings will help you find at compile time code that can try to 
> write into a string constant, but only if you have been very careful 
> about using const in declarations and prototype. Otherwise, it will just 
> be a nuisance; this is why we did not make -Wall request these warnings."
> 
> It should be removed from WARNS=6.

No. Code has to understand that there is a difference between:
const char *
char *
char []

The first is a pointer to a character constant, the second to a character
[field] and the third is a field. E.g. if you want to define a modificable
character constant,
char *foo = "bar";
is wrong. That's a pointer to "bar", the correct syntax is
char foo[] = "bar"

We still want to be very careful about the qualifiers used in interfaces,
but we have to live with the few cases we can't change them.

Joerg



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