.
D 2016-02-24T06:09:53.662
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Tests\sclock-55.9\sand\sclock-55.10\sfail\sfor\sall\s8.6.*\scode\sbases\son\s64-bit\r\nWindows\swhen\susing\sthe\sWindows\s2003\sSDK\scompiler\s(in\sparticular,\sthis\r\nincludes\sActiveState\sreleases\ssince\sthey\sare\sbuilt\swith\sthat\scompiler).\r\n\r\n32-bit\sbuilds\sdo\snot\sexhibit\sthese\sfailures.\s64-bit\sbuilds\swith\soptimization\r\ndisabled\sand\s64-bit\sbuilds\swith\snewer\sVisual\sStudio\s(2013)\salso\sdo\snot\r\nexhibit\sthe\sfailure.\r\n\r\nIt\sappears\sthat\sthe\sfailures\sare\scaused\sby\sthe\sfollowing\sstatement\son\r\nline\s1502\sof\stclClock.c\r\n\r\n\s\s\s\sym1o4\s=\sym1\s/\s4;\r\n\r\nWhen\sym1\sis\s-1\s(0001\sB.C.),\sthe\s2003\sSDK\scompiler\ssets\sym1o4\sto\s-1\r\n(towards\s-infinity)\swhereas\sthe\sVS\s2013\scompiler\ssets\sym1o4\sto\s0\s(towards\s0).\r\nThus\stest\sresults\sare\soff\sby\sexactly\sone\sday.\r\n\r\nI\sthought\sthis\sis\sa\scompiler\sbug,\sbut\sthe\sANSI\sC\s89\sstandard\sstates:\r\n\r\n"If\seither\soperand\sis\snegative,\swhether\sthe\sresult\sof\sthe\s/\soperator\sis\r\nthe\slargest\sinteger\sless\sthan\sthe\salgebraic\squotient\sor\sthe\ssmallest\r\ninteger\sgreater\sthan\sthe\salgebraic\squotient\sis\simplementation-defined"\r\n\r\nAlthough\sthe\sspecific\stest\scase\strigger\sbased\son\snegative\syears,\smy\sfear\r\nis\sthat\sthere\sare\sother\spossibly\smore\scommon\sfailures\slurking\sas\sinteger\r\ndivision\sand\s%\soperations\sare\s(obviously)\sused\sin\smany\splaces\sin\sthe\sclock\r\nimplementation\sand\smay\sinvolve\snegative\soperands.\r\n\r\nReplacing\sthe\sabove\sline\swith\sthe\sfollowing\sfragment\r\n\r\n\s\s\s\sif\s(ym1\s>=\s0)\r\n\s\s\s\s\s\s\s\sym1o4\s=\sym1\s/\s4;\r\n\s\s\s\selse\s{\r\n\s\s\s\s\s\s\s\sym1o4\s=\s-\s(((unsigned\sint)\s-ym1)\s/\s4);\r\n\s\s\s\s}\r\n\r\n(the\scast\sis\snecessary)\sseems\sto\sfix\sthe\sproblem.\sBut\snote\sthere\sare\smany\r\nother\splaces\sthat\swould\sneed\sa\ssimilar\sfix\sand\sI\swould\ssuggest\stoo\srisky\sa\r\nchange\sfor\s8.6.5\r\n\r\n/Ashok
J is_private 0
J login apnadkarni
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter apnadkarni
J subsystem 16.\sCommands\sA-H
J title clock\stest\sfailures\sclock-55.9\sand\sclock-55.10\son\s64-bit\sWindows
J type Bug
K da340d4f3252c73d51b609f01c88236e7b999a11
U apnadkarni
Z dfc28bc67a159e95e475841e4d1a558e