At 9:45 PM -0800 3/17/02, Brent Dax wrote:
>Bryan C. Warnock:
># On Sunday 17 March 2002 00:23, Melvin Smith wrote:
># > encodings/utf32.c:62: warning: cast discards qualifiers
># from pointer
># target
># > type
>#
># Is this solvable?
>
>Not unless there's a 'notconst' keyword or something.  I've tried
>getting rid of these, and as far as I can tell it's impossible.  If
>you've got something like
>
>       void foo(STRING* arg);
>
>       void bar(const STRING* arg) {
>               foo(arg);
>       }
>
>it warns--but it does the same if you do:
>
>               foo((STRING*)arg);
>
>I'd suggest that this be deactivated--I can't see any good coming from
>it.

Actually I'd go with plan B: We don't do that. If we're telling the 
compiler that a parameter to one of our functions is constant, we 
shouldn't then go and change it, even indirectly. Lying to the 
compiler is a Bad Thing--it messes up optimizations. (And if the 
compiler trusts the const-ness of things, potentially fatally)

Either parameters are const and we don't change them, or they're not 
declared const.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to