On Fri, 04 May 2012 22:49:46 -0500 "David C. Rankin" drankinatty@suddenlinkmail.com wrote:
On 05/04/2012 08:44 PM, Mike Bird wrote:
Because the compiler can warn you if somebody changes a declaration and the cast turns into something other than a static cast.
It's better to use a static_cast, dynamic_cast, const_cast or reinterpret_cast than the old-fashioned cast which can try too hard when you'd rather have a warning.
Right now, the compiler will not accept it though. You get a FTBFS with the 2nd patch, the first patch builds fine. How do we fix the 2nd patch?
Actually reinterpret_cast is necessary here. The following code compiles on my system (but not if I use static_cast instead):
int main (int argc, char** argv) { return *(reinterpret_cast<unsigned char*>(*argv)); }