Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TIP 519 compiler warning

Closed / Fixed22547f9053402a46b3149637659f9ee16aa5613aCreated 5 years agoUpdated 5 years ago
Descriptionplain2022-02-18 16:40:09
/home/dgp/fossil/tcl8.7/generic/tclOODefineCmds.c: In function ‘TclOODefineMethodObjCmd’:
/home/dgp/fossil/tcl8.7/generic/tclOODefineCmds.c:2004:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  if (Tcl_GetIndexFromObj(interp, objv[2], exportModes, "export flag",
  ^
Referenced by1
dgp Ticket [22547f9053]: 3 changes [History diff]2022-02-18 16:40:23
jan.nijtmansplain2022-02-18 17:01:50
Fixed [b719e05421270833|here]. The type-cast originally used was illegal anyway (since there is no guarantee that sizeof(enum) == sizeof(int)). Starting with TIP #613, it is now legal to use an enum with Tcl_GetIndexFromObj(), but then the (illegal) type-cast doesn't help anymore to hide the real problem.

Thanks, Don, for noticing this!
Log in (anonymous is fine) to add a comment.