{"action":"created","issue":{"url":"https://api.github.com/repos/arduino/arduino-builder/issues/285","repository_url":"https://api.github.com/repos/arduino/arduino-builder","labels_url":"https://api.github.com/repos/arduino/arduino-builder/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/arduino/arduino-builder/issues/285/comments","events_url":"https://api.github.com/repos/arduino/arduino-builder/issues/285/events","html_url":"https://github.com/arduino/arduino-builder/pull/285","id":354620182,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMzM3ODQy","number":285,"title":"Don't bail out if got include unrelated error while preprocessing","user":{"login":"facchinm","id":8843437,"node_id":"MDQ6VXNlcjg4NDM0Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/8843437?v=4","gravatar_id":"","url":"https://api.github.com/users/facchinm","html_url":"https://github.com/facchinm","followers_url":"https://api.github.com/users/facchinm/followers","following_url":"https://api.github.com/users/facchinm/following{/other_user}","gists_url":"https://api.github.com/users/facchinm/gists{/gist_id}","starred_url":"https://api.github.com/users/facchinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facchinm/subscriptions","organizations_url":"https://api.github.com/users/facchinm/orgs","repos_url":"https://api.github.com/users/facchinm/repos","events_url":"https://api.github.com/users/facchinm/events{/privacy}","received_events_url":"https://api.github.com/users/facchinm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-28T08:16:38Z","updated_at":"2018-08-28T09:03:38Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/arduino/arduino-builder/pulls/285","html_url":"https://github.com/arduino/arduino-builder/pull/285","diff_url":"https://github.com/arduino/arduino-builder/pull/285.diff","patch_url":"https://github.com/arduino/arduino-builder/pull/285.patch"},"body":"Preprocessing is a bit tricky, since it expects an error to resolve missing includes; to do this, it invokes gcc with -CC flag (https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Preprocessor-Options.html#Preprocessor-Options) to expand macro AND comments. Since this flag is not used during normal compilation, the errors reported are mostly bogus.\r\n\r\nThis patch avoids writing the actual (non-include) error on stdout so the compilation can go on and fail on the proper errors (if there's any)\r\n\r\nThis patch fixes https://github.com/arduino/Arduino/issues/7930\r\n\r\n@matthijskooijman since it modifies a bit the behaviour introduced in arduino/arduino-builder@fcc9c5d , could you give it a check before merging? Thanks"},"comment":{"url":"https://api.github.com/repos/arduino/arduino-builder/issues/comments/416507625","html_url":"https://github.com/arduino/arduino-builder/pull/285#issuecomment-416507625","issue_url":"https://api.github.com/repos/arduino/arduino-builder/issues/285","id":416507625,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjUwNzYyNQ==","user":{"login":"facchinm","id":8843437,"node_id":"MDQ6VXNlcjg4NDM0Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/8843437?v=4","gravatar_id":"","url":"https://api.github.com/users/facchinm","html_url":"https://github.com/facchinm","followers_url":"https://api.github.com/users/facchinm/followers","following_url":"https://api.github.com/users/facchinm/following{/other_user}","gists_url":"https://api.github.com/users/facchinm/gists{/gist_id}","starred_url":"https://api.github.com/users/facchinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facchinm/subscriptions","organizations_url":"https://api.github.com/users/facchinm/orgs","repos_url":"https://api.github.com/users/facchinm/repos","events_url":"https://api.github.com/users/facchinm/events{/privacy}","received_events_url":"https://api.github.com/users/facchinm/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T09:03:38Z","updated_at":"2018-08-28T09:03:38Z","author_association":"MEMBER","body":"Macro expansion need to be applied because there is plenty of code like\r\n```\r\n#ifdef __AVR__\r\n#include \"A.h\"\r\n#else\r\n#include \"B.h\"\r\n#endif\r\n```\r\nthat would pick the wrong include without it. So `-C` or `-CC` are needed. `-CC` expands comments but also (from GCC documentation) \r\n`causes all C++-style comments inside a macro to be converted to C-style comments. This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line.` which I find reasonable :slightly_smiling_face: \r\n\r\nApart from that, the biggest problem in the current behaviour is that it reports errors that are not going to appear during compilation. Diagnostic may be improved by adding a line like `Could not detect includes from file \"filename.ccp\" ` in verbose mode, so a proper bugreport would spot them."}}
{"actor":{"display_login":"facchinm"}}