{"action":"created","comment":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/22439244","id":22439244,"diff_hunk":"@@ -164,7 +164,8 @@ class CppMangleVisitor : public Visitor\n                         else\n                         {\n                             dinteger_t val = e->toInteger();\n-                            if (val < 0)\n+                            // TODO: try and do this without knowing what dinteger_t type is\n+                            if ((long)val < 0)","path":"src/cppmangle.c","position":6,"original_position":6,"commit_id":"73844dbcc19a7111c54bc0d643fd8f085df219ee","original_commit_id":"73844dbcc19a7111c54bc0d643fd8f085df219ee","user":{"login":"schveiguy","id":580778,"avatar_url":"https://avatars.githubusercontent.com/u/580778?v=3","gravatar_id":"","url":"https://api.github.com/users/schveiguy","html_url":"https://github.com/schveiguy","followers_url":"https://api.github.com/users/schveiguy/followers","following_url":"https://api.github.com/users/schveiguy/following{/other_user}","gists_url":"https://api.github.com/users/schveiguy/gists{/gist_id}","starred_url":"https://api.github.com/users/schveiguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schveiguy/subscriptions","organizations_url":"https://api.github.com/users/schveiguy/orgs","repos_url":"https://api.github.com/users/schveiguy/repos","events_url":"https://api.github.com/users/schveiguy/events{/privacy}","received_events_url":"https://api.github.com/users/schveiguy/received_events","type":"User","site_admin":false},"body":"> No, in fact it has to be otherwise the negation won't work.\r\n\r\nThis doesn't make sense to me BTW. The whole point of this code is to unset the sign bit. This should make the unsigned version the same as signed version.","created_at":"2015-01-04T13:38:24Z","updated_at":"2015-01-04T13:38:24Z","html_url":"https://github.com/D-Programming-Language/dmd/pull/4239#discussion_r22439244","pull_request_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/22439244"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4239#discussion_r22439244"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239"}}},"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239","id":26779670,"html_url":"https://github.com/D-Programming-Language/dmd/pull/4239","diff_url":"https://github.com/D-Programming-Language/dmd/pull/4239.diff","patch_url":"https://github.com/D-Programming-Language/dmd/pull/4239.patch","issue_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4239","number":4239,"state":"open","locked":false,"title":"Fix warnings on clang++","user":{"login":"schveiguy","id":580778,"avatar_url":"https://avatars.githubusercontent.com/u/580778?v=3","gravatar_id":"","url":"https://api.github.com/users/schveiguy","html_url":"https://github.com/schveiguy","followers_url":"https://api.github.com/users/schveiguy/followers","following_url":"https://api.github.com/users/schveiguy/following{/other_user}","gists_url":"https://api.github.com/users/schveiguy/gists{/gist_id}","starred_url":"https://api.github.com/users/schveiguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schveiguy/subscriptions","organizations_url":"https://api.github.com/users/schveiguy/orgs","repos_url":"https://api.github.com/users/schveiguy/repos","events_url":"https://api.github.com/users/schveiguy/events{/privacy}","received_events_url":"https://api.github.com/users/schveiguy/received_events","type":"User","site_admin":false},"body":"Currently, the default OSX compiler clang reports a boatload of warnings. The vast majority of these warnings have to do with 2 things:\r\n\r\n1. `A && B || C` => clang requires `(A && B) || C` even though operator precedence defines this as the default\r\n2. Some issue with using memcpy to copy the vtable of a class instance (this appears a lot because it's defined in a header file).\r\n\r\nSeeing as these are mostly just busywork to fix, and not helpful to understanding the code, I disabled these warnings.\r\n\r\nIn addition, there are several warnings about using switch with enums that require switch be like D's final switch (all enum members accounted for, cannot use values that don't appear in enum). I disabled this as well.\r\n\r\nFinally, I did modify some code to comply with some other warnings, because these seem worth while:\r\n\r\n1. clang complains that you need to use braces on the outer if statement to avoid confusion with dangling else:\r\n```C\r\nif(cond1)\r\n    if(cond2)\r\n        statement;\r\n    else\r\n        statement;\r\n```\r\n2. To avoid issues where someone types `a || 5` where they really meant `a | 5`, constants must come at the front of any logical boolean expressions. There are many places where constants are used, and modifying the code did not harm anything (and actually logically reads more optimized).\r\n3. Fixed a few issues where a variable might be uninitialized.\r\n4. Fixed an issue where comparing a char to an unsigned int will always fail.\r\n5. Fixed unsigned comparison less than 0.\r\n\r\nNote, there are 2 warnings about unused expressions on some heavy comma operator abuse that I did not touch. Those statements would have to be completely refactored, and I don't feel it's worth the effort. But I did not want to disable that warning.\r\n\r\nTo run with the newly disabled warnings, you must override the compiler on OSX to be clang++ (clang has issues with the auto tester, and so is not the default on OSX):\r\n\r\n`make -f posix.mak HOST_CC=clang++`","created_at":"2015-01-03T05:14:43Z","updated_at":"2015-01-04T13:38:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88998b667f0dcd252b6507a574095560d8d4a00e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239/commits","review_comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239/comments","review_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/{number}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4239/comments","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/73844dbcc19a7111c54bc0d643fd8f085df219ee","head":{"label":"schveiguy:removeclangwarnings","ref":"removeclangwarnings","sha":"73844dbcc19a7111c54bc0d643fd8f085df219ee","user":{"login":"schveiguy","id":580778,"avatar_url":"https://avatars.githubusercontent.com/u/580778?v=3","gravatar_id":"","url":"https://api.github.com/users/schveiguy","html_url":"https://github.com/schveiguy","followers_url":"https://api.github.com/users/schveiguy/followers","following_url":"https://api.github.com/users/schveiguy/following{/other_user}","gists_url":"https://api.github.com/users/schveiguy/gists{/gist_id}","starred_url":"https://api.github.com/users/schveiguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schveiguy/subscriptions","organizations_url":"https://api.github.com/users/schveiguy/orgs","repos_url":"https://api.github.com/users/schveiguy/repos","events_url":"https://api.github.com/users/schveiguy/events{/privacy}","received_events_url":"https://api.github.com/users/schveiguy/received_events","type":"User","site_admin":false},"repo":{"id":2532082,"name":"dmd","full_name":"schveiguy/dmd","owner":{"login":"schveiguy","id":580778,"avatar_url":"https://avatars.githubusercontent.com/u/580778?v=3","gravatar_id":"","url":"https://api.github.com/users/schveiguy","html_url":"https://github.com/schveiguy","followers_url":"https://api.github.com/users/schveiguy/followers","following_url":"https://api.github.com/users/schveiguy/following{/other_user}","gists_url":"https://api.github.com/users/schveiguy/gists{/gist_id}","starred_url":"https://api.github.com/users/schveiguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schveiguy/subscriptions","organizations_url":"https://api.github.com/users/schveiguy/orgs","repos_url":"https://api.github.com/users/schveiguy/repos","events_url":"https://api.github.com/users/schveiguy/events{/privacy}","received_events_url":"https://api.github.com/users/schveiguy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schveiguy/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/schveiguy/dmd","forks_url":"https://api.github.com/repos/schveiguy/dmd/forks","keys_url":"https://api.github.com/repos/schveiguy/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schveiguy/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schveiguy/dmd/teams","hooks_url":"https://api.github.com/repos/schveiguy/dmd/hooks","issue_events_url":"https://api.github.com/repos/schveiguy/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/schveiguy/dmd/events","assignees_url":"https://api.github.com/repos/schveiguy/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/schveiguy/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/schveiguy/dmd/tags","blobs_url":"https://api.github.com/repos/schveiguy/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schveiguy/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schveiguy/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/schveiguy/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schveiguy/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/schveiguy/dmd/languages","stargazers_url":"https://api.github.com/repos/schveiguy/dmd/stargazers","contributors_url":"https://api.github.com/repos/schveiguy/dmd/contributors","subscribers_url":"https://api.github.com/repos/schveiguy/dmd/subscribers","subscription_url":"https://api.github.com/repos/schveiguy/dmd/subscription","commits_url":"https://api.github.com/repos/schveiguy/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/schveiguy/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/schveiguy/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/schveiguy/dmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/schveiguy/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/schveiguy/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schveiguy/dmd/merges","archive_url":"https://api.github.com/repos/schveiguy/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schveiguy/dmd/downloads","issues_url":"https://api.github.com/repos/schveiguy/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/schveiguy/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/schveiguy/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/schveiguy/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schveiguy/dmd/labels{/name}","releases_url":"https://api.github.com/repos/schveiguy/dmd/releases{/id}","created_at":"2011-10-07T11:49:37Z","updated_at":"2015-01-02T15:15:18Z","pushed_at":"2015-01-03T04:48:58Z","git_url":"git://github.com/schveiguy/dmd.git","ssh_url":"git@github.com:schveiguy/dmd.git","clone_url":"https://github.com/schveiguy/dmd.git","svn_url":"https://github.com/schveiguy/dmd","homepage":"d-programming-language.org","size":41971,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"D-Programming-Language:master","ref":"master","sha":"506f2e65b41b655ec71a08f14ebb106231927e3c","user":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"D-Programming-Language/dmd","owner":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/D-Programming-Language/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/D-Programming-Language/dmd","forks_url":"https://api.github.com/repos/D-Programming-Language/dmd/forks","keys_url":"https://api.github.com/repos/D-Programming-Language/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Programming-Language/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Programming-Language/dmd/teams","hooks_url":"https://api.github.com/repos/D-Programming-Language/dmd/hooks","issue_events_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/D-Programming-Language/dmd/events","assignees_url":"https://api.github.com/repos/D-Programming-Language/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/D-Programming-Language/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/tags","blobs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Programming-Language/dmd/languages","stargazers_url":"https://api.github.com/repos/D-Programming-Language/dmd/stargazers","contributors_url":"https://api.github.com/repos/D-Programming-Language/dmd/contributors","subscribers_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscribers","subscription_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscription","commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/D-Programming-Language/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/D-Programming-Language/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Programming-Language/dmd/merges","archive_url":"https://api.github.com/repos/D-Programming-Language/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Programming-Language/dmd/downloads","issues_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Programming-Language/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Programming-Language/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Programming-Language/dmd/labels{/name}","releases_url":"https://api.github.com/repos/D-Programming-Language/dmd/releases{/id}","created_at":"2011-01-15T06:53:53Z","updated_at":"2015-01-04T11:11:34Z","pushed_at":"2015-01-04T11:11:34Z","git_url":"git://github.com/D-Programming-Language/dmd.git","ssh_url":"git@github.com:D-Programming-Language/dmd.git","clone_url":"https://github.com/D-Programming-Language/dmd.git","svn_url":"https://github.com/D-Programming-Language/dmd","homepage":"dlang.org","size":78244,"stargazers_count":890,"watchers_count":890,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":287,"mirror_url":null,"open_issues_count":91,"forks":287,"open_issues":91,"watchers":890,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4239"},"issue":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4239"},"comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4239/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4239/commits"},"statuses":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/73844dbcc19a7111c54bc0d643fd8f085df219ee"}}}}