Tcl Source Code

View Ticket
Login
Ticket UUID: 03cff7a777da6cdf7caace9f0a7d181c685ad799
Title: -Wconversion warnings, like TclAdvanceContinuations()
Type: Bug Created on: 2025-04-16 08:48:15
Submitter: jan.nijtmans Assigned to: jan.nijtmans
Subsystem: - New Builtin Commands Severity: Important
Priority: 5 Medium Last modified: 2025-04-19 16:45:43
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 9.1
Description:

In the past, Tcl/Tk was compiled with -Wconversion warnings turned on. When the move was made to more 64-bit handling, this warning was removed from the CFLAGS, simply because it produced too much unuseful warnings.

As an example TclAdvanceContinuations() is normally called like this (see tclParse.c):

		TclAdvanceContinuations(&line, &clNextOuter,
			tokenPtr->start - outerScript);

Since the last argument is "int loc", a substraction of two pointer (ptrdiff_t) doesn't fit. This might be related to ticket [27b3ce2997].

There are more situations like this, let's see what we can do. The goal is _not_ to fix all -Wconversion warnings.

User Comments:
jan.nijtmans added on 2025-04-17 14:49:09:

First round of fixes [ca9b2d5796c58842|here]

Another round of fixes [d92999333af5bdbf|here]


jan.nijtmans added on 2025-04-19 16:45:43:

Third round of fixes [9f799357d8babf1b|here]