<i>Free-form clock scan reads "+02" as two minutes in 8.6 (backport of
without semantic predicates); the 9.x fix misreads a zone followed by a number</i> status still Open with 3 other changes
by
.
D 2026-09-08T05:59:54.937
J icomment Sergey,\r\n\r\nYou\sare\sright\sabout\sthe\sordering.\r\n\r\nThe\szone-first\scases\sare\snow\sin\stheir\sown\stest,\sclock-59.5.\sIf\syou\sdecide\r\nfree-form\sscan\sshould\snot\saccept\sa\szone\sbefore\sthe\stime,\sdelete\sthat\sone\stest\r\nand\snothing\selse\schanges.\sThat\stest\sis\sthe\sonly\scoverage\sof\sthe\stISOBASE\shalf\r\nof\sthe\slookahead\scheck.\sI\smeasured\sthis\s-\sremove\sthe\stISOBASE\sclause\sand\r\nclock-59.5\sis\sthe\sonly\stest\sthat\sfails.\sSo\sif\sthe\szone-first\sorder\sgoes,\sthat\r\nclause\scan\sgo\swith\sit.\r\n\r\nHow\sthis\scame\sup:\sI\sbuild\sand\stest\sTcl\s8.6\sagainst\sthe\ssystem's\stzdata\srather\r\nthan\sthe\sbundled\scopy.\sRunning\sthe\s8.6\ssuite\sin\sthat\sconfiguration\sis\swhat\r\nsurfaced\sit.\r\n\r\nThe\smain\sbug\sis\sthe\strailing\sform:\r\n\r\n\s\s\s\sclock\sscan\s{2023-11-15\s00:13:20\s+02}\s-gmt\s1\r\n\r\nStock\s8.6.18\sreturns\s1700007080.\sThe\scorrect\svalue\sis\s1700000000.\sA\ssigned\r\nzone\sis\sread\sas\shhmm\swhatever\sits\slength,\sso\s"+02"\sbecomes\stwo\sminutes.\sThat\r\nis\show\sthe\ssystem\szoneinfo\swrites\sthe\s%Z\sabbreviation,\sso\sclock\sformat\soutput\r\ndoes\snot\ssurvive\sa\sround\strip\sthrough\sclock\sscan\s(Tcl's\sbundled\stzdata\swrites\r\n"+0200"\sfor\s%Z,\swhich\sis\swhy\sclock-59.2\spasses\stoday.\s%z\sis\salways\sfour\sdigits\r\nand\sis\snever\saffected).\r\n\r\nThe\sclearest\sdemonstration\sis\sto\sbuild\s8.6\swithout\sbundled\stzdata\sand\srun\r\nclock.test.\sStock\sfails\sclock-59.2,\sand\swith\sthis\sbranch\sit\spasses.\sOn\sa\r\nsystem\swhose\szoneinfo\salso\slacks\sCET,\sUS/Eastern\sand\sUS/East-Indiana\syou\swill\r\nsee\sclock-30.33,\s30.34,\s39.1\sand\s44.1\sfail\sas\swell,\sin\sstock\sand\sin\sthe\sbranch\r\nalike.\sThose\sare\smissing-zone\serrors\sfrom\sthe\stzdata\sinstall\srather\sthan\r\nanything\sto\sdo\swith\sthis\sbug,\sand\sI\sshould\snot\shave\slisted\sthem\salongside\r\n59.2.\r\n\r\nThe\sbranch\sis\sbug-7bad415e3e-8.6.\sIt\suses\sno\ssemantic\spredicate,\sbecause\syour\r\ncomment\son\s[51aa53616067cb63]\sraised\sthe\solder-bison\squestion.\sThe\sexisting\r\n"sign\stUNUMBER"\saction\sdecides\shours\sor\shhmm\sitself.\sWhen\sthe\sparser\sholds\sa\r\nnumeric\slookahead,\sit\sreads\sthe\sdigit\scount\srecorded\sbefore\sthat\slookahead.\r\ntclDate.c\swas\sregenerated\swith\sbison\s3.8.2\sby\sgendate.\s14\sshift/reduce\r\nconflicts,\sthe\ssame\sas\sstock.\r\n\r\nThe\sbranch\salso\sinitialises\sthe\stwo\sdigit-count\sfields\sin\r\nTclClockOldscanObjCmd.\sThat\sfunction\ssets\severy\sother\s`yy*`\sfield\sbefore\r\nyyparse\sbut\snot\syyDigitCount,\sand\s"number:\stUNUMBER"\sreads\sit\sat\sthe\r\n"yyDigitCount\s<=\s2"\stest,\swhich\sis\sa\spath\s"last"\sreaches\sbecause\sLookupWord\r\nreturns\sit\sas\stUNUMBER\swithout\spassing\sthe\sdigit\sscanner.\sSo\sstock\sreads\san\r\nuninitialised\sstack\svalue\sthere.\r\n\r\nThe\sread\sis\sreal\sand\sI\scan\smove\sit,\sbut\sonly\sfrom\sC.\sSeeding\syyDigitCount\swith\r\n3\sor\smore\sbefore\sthe\sparse\schanges\r\n\r\n\s\s\s\sclock\sscan\s{last}\s-base\s1700000000\s-gmt\s1\r\n\r\nfrom\s1699916400\sto\s1699919940.\sSeeding\syyPrevDigitCount\salone\schanges\snothing:\r\nthe\skeyword\spath\sassigns\sthat\sfield\sand\snever\sassigns\syyDigitCount,\swhich\sis\r\nthe\sone\s"number:\stUNUMBER"\sreads.\sWhat\sI\scould\snot\sdo\sis\sreach\sit\sfrom\sa\r\nscript\s-\sstock\sas\sshipped\sgives\s1699916400,\sand\sso\sdoes\sstock\safter\sa\r\npreceding\sclock\sscan\sof\s{1234},\s{20231115\s001320},\s{12}\sor\s{1130},\sbecause\sthe\r\nstack\sslot\sdoes\snot\scarry\sover.\sBecause\sof\sthat,\sI\shave\swritten\sno\stest.\r\nWithout\sediting\sthe\sC\sthere\sis\sno\sbuild\son\swhich\sone\swould\sdiscriminate,\sso\sit\r\nwould\spass\seither\sway\sand\sbe\sa\sfalse\scontrol.\r\n\r\nOne\sbehaviour\schange\sfrom\sthe\slookahead\swork\sitself:\r\n\r\n\s\s\s\sclock\sscan\s{+last}\s-base\s1700000000\s-gmt\s1\r\n\s\s\s\s\s\s\s\sstock\s1700000060\s\s\s\sthis\sbranch\s1700003600\s\s\s\s9.0.5\s1700003600\r\n\r\nThat\sone\sis\snot\sthe\sinitialisation,\sremoving\sthose\stwo\slines\sleaves\sit\sat\r\n1700003600.\sThe\sguard\sis\syyDigitCount\s<=\s2,\sso\severy\snegative\svalue\sbehaves\r\nexactly\slike\s0,\sand\sI\scould\snot\sproduce\sa\sbuild\swhere\sthe\sremoval\salone\swas\r\nvisible,\sincluding\sone\scompiled\swith\s-ftrivial-auto-var-init=pattern,\swhich\r\nchanges\snothing\sbecause\sthe\sfill\sis\snegative\sas\san\sint\s(0xFEFEFEFE\sunder\sgcc,\r\n0xAAAAAAAA\sunder\sclang).\sSeeding\sthe\sfield\swith\s3\sor\smore\sdoes\sgive\sstock's\r\n1700000060.\sThe\sread\sis\sreal,\sand\sit\sis\sundefined\sbehaviour\seither\sway.\sThe\r\nremoval\sis\squiet\sbecause\sof\swhat\sthe\scaller's\sstack\sand\sthe\scompiler\shappen\sto\r\nleave,\snot\sbecause\sthe\slines\sdo\snothing.\sWith\sthe\slines\sremoved\sthe\sslot\r\narrives\sas\s0\son\splain\s-O2\sand\sas\s0xFEFEFEFE\sunder\sthe\spattern\sflag,\sboth\son\r\nthe\s<=\s2\sside.\sThe\sbranch\sas\ssubmitted\sinitialises\sthe\sfield\sand\sreturns\r\n1700003600\sfor\sthat\sreason\srather\sthan\sby\sluck,\swhich\sis\sthe\sargument\sfor\r\nkeeping\sthose\stwo\slines.\r\n\r\nTwo\smeasurements\son\s9.0.5,\sin\scase\sthey\sare\suseful\sto\syou:\r\n\r\n\s\s\s\sclock\sscan\s{2023-11-15\s00:13:20\s+02}\s-gmt\s1\s\s\s\s\s\s\s\s->\s1700000000\s\scorrect\r\n\s\s\s\sclock\sscan\s{2023-11-15\s00:13:20\s+02\s2024}\s-gmt\s1\s\s\s->\s1731629480\s\s7080\ss\soff\r\n\r\nThe\ssecond\sshould\sdiffer\sfrom\sthe\sfirst\sonly\sin\sthe\syear.\sThis\sbranch\sgives\r\n1731622400,\swhich\sis\swhat\sglibc\sgives\sfor\sthe\ssame\sinstant\swritten\sas\sa\sdate\r\nit\saccepts:\sdate\s-u\s-d\s'2024-11-15\s00:13:20\s+02'\s+%s.\sSo\s8.6\swith\sthis\schange\r\nand\s9.0.5\sdisagree\son\sa\szone\sfollowed\sby\sa\snumber.\sI\sthink\s9.x\sis\sthe\sone\sto\r\ncorrect,\sI\sjust\sdidn't\swant\sthe\sdifference\sto\sbe\sa\ssurprise.\r\n\r\nMy\sfirst\sversion\sof\sthis\spatch\shad\sthe\ssame\skind\sof\sbug\sI\sam\sdescribing\sin\r\n9.x:\s"last"\sis\sreturned\sas\stUNUMBER\sby\sLookupWord\swithout\spassing\sthe\sdigit\r\nscanner,\sso\s"clock\sscan\s{+0200\slast\smonth}"\sregressed\sagainst\sstock.\sThat\sis\r\nfixed\sand\sclock-59.6\spins\sit.\sA\slater\scheck\sfound\sthat\smy\sISO-base\stest\sno\r\nlonger\scovered\sthe\sclause\sit\swas\swritten\sfor,\sbecause\sI\shad\schanged\sit\sto\sa\r\nfour-digit\szone.\sThat\sis\sfixed\stoo.\sBoth\serrors\swere\smine.\r\n\r\nThere\sare\sthree\srelated\spre-existing\sissues\sI\sdid\snot\stouch,\sI'm\shappy\sto\sfile\r\nthem\sseparately\sif\sthat\sis\suseful.\sI\schecked\seach\sagainst\s9.0.5.\r\n\r\n\s\s-\s"number:\stUNUMBER"\sreads\syyDigitCount\swith\sthe\ssame\slookahead\sproblem.\r\n\s\s\s\sclock\sscan\s{1130\s15\sNov\s2023}\s-gmt\s1\sgives\s1704074400\sin\sstock\s8.6,\swhere\r\n\s\s\s\sGNU\sdate\sgives\s1700047800.\s9.0.5\sraises\san\serror\son\sthat\sinput\srather\sthan\r\n\s\s\s\sanswering\sit.\r\n\s\s-\sthe\snon-J\s"n"\sday-of-year\sform\sis\sone\sday\sout.\sDeterminePosixDSTTime\sputs\r\n\s\s\s\sthe\s0-based\sn\sinto\sthe\s1-based\sdayOfYear\sfield.\sThis\sone\sis\sin\s9.0.5:\swith\r\n\s\s\s\sEST5EDT,59,300\sin\s2032,\sglibc\sstarts\sDST\son\s29\sFebruary\sand\s9.0.5\son\sthe\r\n\s\s\s\s28th,\sand\sn=58\sand\sn=60\sare\sa\sday\searly\sthere\sas\swell.\r\n\s\s-\s`<zone>\stomorrow`\sparses\sthrough\sa\sdifferent\srule\sand\sis\san\sissue\son\sstock.\r\n\s\s\s\s9.0.5\sis\scorrect,\s{+0200\stomorrow}\sand\s{tomorrow\s+0200}\sboth\sgive\r\n\s\s\s\s1699999200\sthere,\swhere\sstock\s8.6\sgives\s1717200000\sand\s1699999200.\r\n\r\nKenneth
J login kenneth.kienle
J mimetype text/x-markdown
K 7bad415e3ec8baf40d087374000fbcbab511689c
U kenneth.kienle
Z a3e37cc34d1f1cfd6a1e3fcb6adabd25