{"action":"created","issue":{"url":"https://api.github.com/repos/z88dk/z88dk/issues/95","repository_url":"https://api.github.com/repos/z88dk/z88dk","labels_url":"https://api.github.com/repos/z88dk/z88dk/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/z88dk/z88dk/issues/95/comments","events_url":"https://api.github.com/repos/z88dk/z88dk/issues/95/events","html_url":"https://github.com/z88dk/z88dk/issues/95","id":211741009,"number":95,"title":"classic: problem with enabling %ld and %e for printf","user":{"login":"aralbrec","id":13653828,"avatar_url":"https://avatars3.githubusercontent.com/u/13653828?v=3","gravatar_id":"","url":"https://api.github.com/users/aralbrec","html_url":"https://github.com/aralbrec","followers_url":"https://api.github.com/users/aralbrec/followers","following_url":"https://api.github.com/users/aralbrec/following{/other_user}","gists_url":"https://api.github.com/users/aralbrec/gists{/gist_id}","starred_url":"https://api.github.com/users/aralbrec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aralbrec/subscriptions","organizations_url":"https://api.github.com/users/aralbrec/orgs","repos_url":"https://api.github.com/users/aralbrec/repos","events_url":"https://api.github.com/users/aralbrec/events{/privacy}","received_events_url":"https://api.github.com/users/aralbrec/received_events","type":"User","site_admin":false},"labels":[{"id":342594055,"url":"https://api.github.com/repos/z88dk/z88dk/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-03T16:46:19Z","updated_at":"2017-03-04T19:49:35Z","closed_at":null,"body":"I ran into this problem while compiling Whetstone with the classic library.\r\n\r\nThe output is not displayed properly as if %ld and %e are not enabled for printf (the output shows \"ld\" and \"e\" in the printed text).\r\n\r\n[Overview of whetstone](https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/EXAMPLES/benchmarks/whetstone/readme.txt)\r\n[Compile instructions for z88dk](https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/EXAMPLES/benchmarks/whetstone/z88dk/readme.txt)\r\n\r\nThe [whetstone source code](https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/EXAMPLES/benchmarks/whetstone/z88dk/whetstone.c) can be compiled from:\r\nz88dk/libsrc/_DEVELOPMENT/EXAMPLES/benchmarks/whetstone/z88dk\r\n\r\nA specific compile line targetting the zx spectrum using sccz80/genmath:\r\n`zcc +zx -vn -O2 -DSTATIC -DTIMER -DPRINTOUT whetstone.c -o whetstone -lm -lndos -m -create-app`\r\nYou will see the incorrectly printed results as output when run.\r\n\r\nA correct compile targetting the zx spectrum using zsdcc/math48 for reference in this [tap file](https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/EXAMPLES/benchmarks/whetstone/z88dk/whetstone.tap).\r\n\r\nIn the whetstone source code I am enabling %ld and %e (among other converters) with:\r\n\r\n```\r\n#ifdef __Z88DK\r\n   #include <intrinsic.h>\r\n   #ifdef PRINTOUT\r\n      #pragma output CLIB_OPT_PRINTF = 0x05001001\r\n   #endif\r\n#endif\r\n```\r\n\r\n__Z88DK is defined in zx.cfg\r\n"},"comment":{"url":"https://api.github.com/repos/z88dk/z88dk/issues/comments/284176279","html_url":"https://github.com/z88dk/z88dk/issues/95#issuecomment-284176279","issue_url":"https://api.github.com/repos/z88dk/z88dk/issues/95","id":284176279,"user":{"login":"suborb","id":394721,"avatar_url":"https://avatars3.githubusercontent.com/u/394721?v=3","gravatar_id":"","url":"https://api.github.com/users/suborb","html_url":"https://github.com/suborb","followers_url":"https://api.github.com/users/suborb/followers","following_url":"https://api.github.com/users/suborb/following{/other_user}","gists_url":"https://api.github.com/users/suborb/gists{/gist_id}","starred_url":"https://api.github.com/users/suborb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suborb/subscriptions","organizations_url":"https://api.github.com/users/suborb/orgs","repos_url":"https://api.github.com/users/suborb/repos","events_url":"https://api.github.com/users/suborb/events{/privacy}","received_events_url":"https://api.github.com/users/suborb/received_events","type":"User","site_admin":false},"created_at":"2017-03-04T19:49:35Z","updated_at":"2017-03-04T19:49:35Z","body":"I've tracked this down to __printf_print_aligned - there's a call to l_ge which assumed that hl is left undisturbed. The fix for #90 made the comparison routines set hl which broke that assumption."}}
{"actor":{"display_login":"suborb"}}