Re: Weird malloc behaviour



On Thu, 31 Jul 2008 19:45:46 +0100, Ben Bacarisse
<ben.usenet@xxxxxxxxx> wrote:

Barry Schwarz <schwarzb@xxxxxxxx> writes:

<snip>
... A few of the common correct uses of a cast are:

I'd add: passing a T ** (or a T *const *) to a function that wants a
const T *const * parameter.

Is there not a one way implicit conversion adding as many const as
needed? A T* will be converted to const T* with no problem (e.g.,
strcpy). Is a T** different?

--
Remove del for email
.



Relevant Pages

  • Re: Secure C library
    ... >String to (const) char *. ... Every time such an implicit conversion occurs, ... to the unsafe semantics, ...
    (comp.std.c)
  • Re: Weird malloc behaviour
    ... const T *const * parameter. ... Is there not a one way implicit conversion adding as many const as ... Comeau C/C++ with Dinkumware's Libraries... ...
    (comp.lang.c)
  • Re: Secure C library
    ... An alternative would be to have an implicit conversion from ... String to (const) char *. ...
    (comp.std.c)
  • Re: Casting const char* to void*
    ... Once you cast away ... >the const, the implicit conversion to void* will work. ...
    (comp.lang.cpp)
  • Re: Should function argument be changed in function body?
    ... snip ... ... >>> attach 'const' to any parameters that are not modified. ... >> impose an extra anomalous connection between code modules. ...
    (comp.lang.c)