[PD] pd-extended build on 9.10 /gem 0.92.1 eeepc = no luck with v4l2
Claude Heiland-Allen
claudiusmaximus at goto10.org
Thu Nov 5 15:08:26 CET 2009
zmoelnig at iem.at wrote:
> Quoting "Mathieu Bouchard" <matju at artengine.ca>:
>> hi, the problem is not the type of «filename», it's the type of
>> «extension», because the error message is about casting const to
>> non-const, and not the other way around.
True - nicely spotted.
> "man strrchr" says:
> char *strrchr(const char *s, int c);
Sure, but that's the C version, I imagine?
"two overloaded versions provided in C++."
-- http://www.cplusplus.com/reference/clibrary/cstring/strrchr/
> i don't see any problems here. what is it, that i am missing?
C != C++
C++ should use only the argument types to determine which function to
call (if my memory is correct).
So a const argument forces C++ strrchr to return a const result (which
is semantically correct, imho the C version is incorrectly specified to
the point of being dangerous).
This cannot be converted to a non-const value without explicit casting
(and arguably shouldn't be casted at all, as const values could well be
in read-only memory, causing crashes when modification is attempted).
Claude
--
http://claudiusmaximus.goto10.org
More information about the Pd-list
mailing list