Compiled [clock clicks -mi] returns microseconds instead of an ambiguous option error
Closed / Fixed1ae976e237cf0a4d040de9435ce0554a8c8c7606Created 51 days agoUpdated 50 days ago
Descriptionwiki2026-10-12 20:32:40
clock clicks -mi is an error ("ambiguous option "-mi": must be
-milliseconds or -microseconds"), but in compiled code 9.1 accepts it and
returns microseconds:
proc p {} {clock clicks -mi}
p
9.0 compiles the option only if it is at least 4 characters long, so it gives
the error in both cases. [507b920e63] (TIP 720) replaced that check with
IS_TOKEN_PREFIX(tokenPtr, 3, ...).
Proposed fix in branch compile-clock-clicks-ambiguous: require 4 characters again. Tests clock-33.7.1 and clock-33.7.2.
Referenced by2
49311822fdTicket [3069454fff] difference between bcc'ed and eval'ed regexp status still Open with 3 other changes ticket2026-10-12 20:37:461ec16daa80Fix [1ae976e237]: compiled [clock clicks -mi] returned microseconds instead of the "ambiguous option" error of the command. Since [507b920e63] (TIP 720) the compiler accepted prefixes of 3 characters; require 4 again, as before. check-in2026-10-12 20:29:42
jan.nijtmanswiki2026-10-13 12:15:42
Fixed in [trunk]
Many thanks!
Log in (anonymous is fine) to add a comment.