{"action":"closed","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4750","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4750/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4750/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4750/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4750","id":124337342,"number":4750,"title":"StringTools.isEof and -xml compilation","user":{"login":"Simn","id":634365,"avatar_url":"https://avatars.githubusercontent.com/u/634365?v=3","gravatar_id":"","url":"https://api.github.com/users/Simn","html_url":"https://github.com/Simn","followers_url":"https://api.github.com/users/Simn/followers","following_url":"https://api.github.com/users/Simn/following{/other_user}","gists_url":"https://api.github.com/users/Simn/gists{/gist_id}","starred_url":"https://api.github.com/users/Simn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simn/subscriptions","organizations_url":"https://api.github.com/users/Simn/orgs","repos_url":"https://api.github.com/users/Simn/repos","events_url":"https://api.github.com/users/Simn/events{/privacy}","received_events_url":"https://api.github.com/users/Simn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/feature-analyzer","name":"feature-analyzer","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"Simn","id":634365,"avatar_url":"https://avatars.githubusercontent.com/u/634365?v=3","gravatar_id":"","url":"https://api.github.com/users/Simn","html_url":"https://github.com/Simn","followers_url":"https://api.github.com/users/Simn/followers","following_url":"https://api.github.com/users/Simn/following{/other_user}","gists_url":"https://api.github.com/users/Simn/gists{/gist_id}","starred_url":"https://api.github.com/users/Simn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simn/subscriptions","organizations_url":"https://api.github.com/users/Simn/orgs","repos_url":"https://api.github.com/users/Simn/repos","events_url":"https://api.github.com/users/Simn/events{/privacy}","received_events_url":"https://api.github.com/users/Simn/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-30T11:37:53Z","updated_at":"2015-12-30T18:01:09Z","closed_at":"2015-12-30T18:01:09Z","body":"I noticed something funny in haxe.xml.Parser when compiling all.hxml:\r\n\r\n```haxe\r\nusing StringTools;\r\n\r\nclass Main {\r\n\tstatic function main() {\r\n\t\tvar str = \"foo\";\r\n\t\tvar p = 0;\r\n\t\tvar c = str.fastCodeAt(p);\r\n\t\twhile (!StringTools.isEof(c)) {\r\n\t\t\tc = str.fastCodeAt(++p);\r\n\t\t}\r\n\t\ttrace(\"ok\"); // Warning : Unreachable code\r\n\t}\r\n}\r\n```\r\n\r\nI was about to panic when I saw that StringTools.iseof has this:\r\n\r\n```haxe\r\n#else\r\nreturn false;\r\n#end\r\n```\r\n\r\nThis indeed means that the while-loop is infinite. It doesn't matter because \"cross\" code is never actually evaluated, but it's relevant for analysis. I also wonder if there are other cases like that in the standard library."}}