|
2023-08-28
| ||
| 08:06 | • Closed ticket [36bcf04a70]: Pointer size warnings when compiling on a 32-bit mac... artifact: 8ad545547d user: jan.nijtmans | |
| 06:39 | • Ticket [36bcf04a70]: 3 changes artifact: adf4e95d20 user: chrstphrchvz | |
|
2023-08-10
| ||
| 11:45 | • Ticket [36bcf04a70]: 3 changes artifact: b6eeaaf827 user: chrstphrchvz | |
| 11:44 | • Add attachment 36bcf04a70.diff to ticket [36bcf04a70] artifact: 5d2a27ebe1 user: chrstphrchvz | |
|
2023-08-09
| ||
| 11:18 | • New ticket [36bcf04a70] Pointer size warnings when compiling on a 32-bit machine... artifact: ca1ea7e229 user: stu | |
Pointer size warnings when compiling on a 32-bit machine
Closed / Fixed36bcf04a704a22f3578ea0d93e0401eb5d0afcb3Created 3 years agoUpdated 3 years ago
Descriptionplain2023-08-09 11:18:23
Edited to shorten paths:
generic/tclInt.h:4358:12: warning: incompatible pointer types passing 'Tcl_Size *' (aka 'long *') to parameter of type 'int *' [-Wincompatible-pointer-types]
return TclGetIntFromObj(interp, objPtr, sizePtr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generic/tclInt.h:2757:46: note: expanded from macro 'TclGetIntFromObj'
: Tcl_GetIntFromObj((interp), (objPtr), (intPtr)))
^~~~~~~~
generic/tclDecls.h:152:27: note: passing argument to parameter 'intPtr' here
Tcl_Obj *objPtr, int *intPtr);
chrstphrchvzwiki2023-08-10 11:45:06
The warning is about how C considers pointers to different integer types to be incompatible, regardless of whether the types have the same size.
TCL_SIZE_MAX == INT_MAX does not necessarily mean Tcl_Size is int. Using a temporary int avoids the warning; see attached patch.
chrstphrchvzwiki2023-08-28 06:39:37
The patch I attached was superseded by [2e65fce4cf]. But should Tcl be assuming that TCL_SIZE_MAX == INT_MAX implies sizeof(Tcl_Size) == sizeof(int)? Since the condition is no longer meant for the preprocessor, should Tcl just check sizeof(…) instead?
jan.nijtmanswiki2023-08-28 08:06:13
> should Tcl just check sizeof(…) instead?
It doesn't really matter (IMHO), but since TCL_SIZE_MAX is non-C-standard it would be - slightly - better.
Closing. [e94242449556e1fd]
Log in (anonymous is fine) to add a comment.
Attachments:
- 36bcf04a70.diff [download] added by chrstphrchvz on 2023-08-10 11:44:58. [details]