[Coin-discuss] CoinStrdup warning

Laszlo Ladanyi ladanyi at us.ibm.com
Sun Nov 16 13:18:11 EST 2008


Done in trunk and in stable/2.3. At least I think the explicit 
static_cast I did should get rid of the warning. Could you test it?

Thanks,
--Laci

On Sun, 16 Nov 2008, Matthew Galati wrote:

> Can someone please cleanup this warning? It is an easy one.Thanks. Matt
>
> 1>c:\cygwin\home\magala\COIN\coin-Decomp\CoinUtils\src\CoinHelperFunctions.hpp(501)
> : warning C4267: 'initializing' : conversion from 'size_t' to 'const
> int', possible loss of data
>
> /** Returns strdup or NULL if original NULL */
> inline char * CoinStrdup(const char * name)
> {
>  char* dup = NULL;
>  if (name) {
>    const int len = strlen(name);
>    dup = (char*)malloc(len+1);
>    CoinMemcpyN(name, len, dup);
>    dup[len] = 0;
>  }
>  return dup;
> }
>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>




More information about the Coin-discuss mailing list