{"action":"created","issue":{"url":"https://api.github.com/repos/DaveGamble/cJSON/issues/85","repository_url":"https://api.github.com/repos/DaveGamble/cJSON","labels_url":"https://api.github.com/repos/DaveGamble/cJSON/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/DaveGamble/cJSON/issues/85/comments","events_url":"https://api.github.com/repos/DaveGamble/cJSON/issues/85/events","html_url":"https://github.com/DaveGamble/cJSON/issues/85","id":195439193,"number":85,"title":"-Werror=strict-overflow compile error","user":{"login":"danomimanchego123","id":24559665,"avatar_url":"https://avatars.githubusercontent.com/u/24559665?v=3","gravatar_id":"","url":"https://api.github.com/users/danomimanchego123","html_url":"https://github.com/danomimanchego123","followers_url":"https://api.github.com/users/danomimanchego123/followers","following_url":"https://api.github.com/users/danomimanchego123/following{/other_user}","gists_url":"https://api.github.com/users/danomimanchego123/gists{/gist_id}","starred_url":"https://api.github.com/users/danomimanchego123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danomimanchego123/subscriptions","organizations_url":"https://api.github.com/users/danomimanchego123/orgs","repos_url":"https://api.github.com/users/danomimanchego123/repos","events_url":"https://api.github.com/users/danomimanchego123/events{/privacy}","received_events_url":"https://api.github.com/users/danomimanchego123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-14T04:44:38Z","updated_at":"2016-12-15T10:18:40Z","closed_at":"2016-12-15T10:14:18Z","body":"Hello,\r\n\r\nOver in buildroot land, the autobuilders encountered this following error, when using sh4a and powerpc toolchains: \r\n\r\n`cJSON.c:494:43: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]`\r\n\r\nThis error can be avoided by changing the `len` variable in `parse_string()` from `int` to `unsigned`.   Or, you can keep `len` as an `int`, but move the `++len` out of the `while` test, and into the `while` body, as the pre-increment means that `++len` is not useful for making the `while` test fail.  (Which is why the conditional is simplified by the compiler.)\r\n\r\nCan you consider making this fix?\r\n\r\ni'm also wondering, now that there are official releases, if it would be wise to remove -Werror from the compile options, or only enabling it conditionally.  Don't get me wrong - Werror and Wextra are great during development, but not so good for deployment, where the archive might travel to projects with toolchains that are much newer, older, or very different from what you normally work with ...\r\n\r\nThanks for cJSON - it's awesome!\r\n\r\nDanomi -\r\n"},"comment":{"url":"https://api.github.com/repos/DaveGamble/cJSON/issues/comments/267291902","html_url":"https://github.com/DaveGamble/cJSON/issues/85#issuecomment-267291902","issue_url":"https://api.github.com/repos/DaveGamble/cJSON/issues/85","id":267291902,"user":{"login":"FSMaxB","id":4294942,"avatar_url":"https://avatars.githubusercontent.com/u/4294942?v=3","gravatar_id":"","url":"https://api.github.com/users/FSMaxB","html_url":"https://github.com/FSMaxB","followers_url":"https://api.github.com/users/FSMaxB/followers","following_url":"https://api.github.com/users/FSMaxB/following{/other_user}","gists_url":"https://api.github.com/users/FSMaxB/gists{/gist_id}","starred_url":"https://api.github.com/users/FSMaxB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FSMaxB/subscriptions","organizations_url":"https://api.github.com/users/FSMaxB/orgs","repos_url":"https://api.github.com/users/FSMaxB/repos","events_url":"https://api.github.com/users/FSMaxB/events{/privacy}","received_events_url":"https://api.github.com/users/FSMaxB/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T10:18:40Z","updated_at":"2016-12-15T10:18:40Z","body":"Thanks for reporting this. Not enabling `-Werror` in production build has the benefit, that the build doesn't break out of nowhere, but it also means that I will never see most issues like this reported and will never be able to fix them. So this is kind of a dilemma. Also from a security perspective you wouldn't want some of these errors to go unnoticed."}}
{"actor":{"display_login":"FSMaxB"}}