does this code break the strict-aliasing rules ?
Michael Haubenwallner
michael.haubenwallner@salomon.at
Tue Feb 6 15:58:00 GMT 2007
Hi,
encountering strange results, I'm unsure whether this code is affected
by strict-aliasing rules:
static void *CreateRes(PrexecTresource eRes, void *pvVal)
{
switch(eRes) {
case PrexecNprintCommand:
case PrexecNoptHost:
case PrexecNoptHostString:
case PrexecNoptDest:
case PrexecNoptDestString:
case PrexecNoptFileString:
if (pvVal != NULL) {
pvVal = (void*)strdup((char*)pvVal);
}
break;
default:
break;
}
return pvVal;
}
Specifically the casts around the 'strdup'...
Thanks,
/haubi/
More information about the Gcc-help
mailing list