{"action":"created","issue":{"url":"https://api.github.com/repos/biicode/client/issues/18","labels_url":"https://api.github.com/repos/biicode/client/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/biicode/client/issues/18/comments","events_url":"https://api.github.com/repos/biicode/client/issues/18/events","html_url":"https://github.com/biicode/client/issues/18","id":71337317,"number":18,"title":"Show warnings only for open blocks","user":{"login":"smessmer","id":2373925,"avatar_url":"https://avatars.githubusercontent.com/u/2373925?v=3","gravatar_id":"","url":"https://api.github.com/users/smessmer","html_url":"https://github.com/smessmer","followers_url":"https://api.github.com/users/smessmer/followers","following_url":"https://api.github.com/users/smessmer/following{/other_user}","gists_url":"https://api.github.com/users/smessmer/gists{/gist_id}","starred_url":"https://api.github.com/users/smessmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smessmer/subscriptions","organizations_url":"https://api.github.com/users/smessmer/orgs","repos_url":"https://api.github.com/users/smessmer/repos","events_url":"https://api.github.com/users/smessmer/events{/privacy}","received_events_url":"https://api.github.com/users/smessmer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-27T16:32:21Z","updated_at":"2015-05-07T16:40:27Z","closed_at":null,"body":"(see http://forum.biicode.com/t/show-warnings-only-for-open-blocks/334 )\r\n\r\nI'd like to use warning flags like \"-Wall -Wextra -Weffc++\" on my code, but using\r\n\r\n    TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE -Wall -Wextra -Weffc++)\r\n\r\nshows a lot of warnings for the blocks I'm including (e.g. boost).\r\n\r\n**Reasoning**\r\nI generally assume the libraries I use are working, but might not be written using good C++ style. Some libraries might be written well, but still throw warnings on -Weffc++, because they use certain constructs for performance (e.g. boost often doesn't have virtual destructors on inherited classes).\r\n\r\nAs a developer using an arbitrary library, it is not necessarily my task to remove the warnings from their code (which might sometimes not be possible like in the boost example above), but I'd like to use the warnings mechanism to be notified of style issues in my own code. Warnings in code written by others just clutters the output and makes it harder for me to find the issues in my own code.\r\n\r\nMany languages (e.g. Java, Scala, ...) only show you warnings in your own code and I think that this generally is the better approach. But because of the C++ header inclusion mechanism, compilers can't easily distinguish whether you're including a header you've written yourself or a header from a library.\r\nThey actually can distinguish whether you're including a system header, and in this case, they also hide the warnings from there. But they can't easily distinguish 3rd party library headers from your own headers (the 3rd party library might just be in some subfolder of your project for example).\r\n\r\nDifferent to plain compilers, biicode is in a position to easily decide whether a header is a 3rd party header or not (open blocks are own code, closed blocks 3rd party). So biicode might have the chance here to be better than previous systems.\r\n\r\nSince this is a behavior C++ programmers might not be used to, an opt-in or opt-out could be offered. I'll definitely opt-in, because I think it is much better behavior.\r\n\r\n**Possible implementation**\r\n I've read that including other libraries as system libraries makes gcc ignore warnings for these library headers. This could for example be done with\r\n\r\n    include_directories(SYSTEM \"${LIB_DIR}/Include\")\r\n\r\nIs it possible to include closed blocks this way and therefore make gcc only show warnings for open blocks?\r\n"},"comment":{"url":"https://api.github.com/repos/biicode/client/issues/comments/99932898","html_url":"https://github.com/biicode/client/issues/18#issuecomment-99932898","issue_url":"https://api.github.com/repos/biicode/client/issues/18","id":99932898,"user":{"login":"drodri","id":1108595,"avatar_url":"https://avatars.githubusercontent.com/u/1108595?v=3","gravatar_id":"","url":"https://api.github.com/users/drodri","html_url":"https://github.com/drodri","followers_url":"https://api.github.com/users/drodri/followers","following_url":"https://api.github.com/users/drodri/following{/other_user}","gists_url":"https://api.github.com/users/drodri/gists{/gist_id}","starred_url":"https://api.github.com/users/drodri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drodri/subscriptions","organizations_url":"https://api.github.com/users/drodri/orgs","repos_url":"https://api.github.com/users/drodri/repos","events_url":"https://api.github.com/users/drodri/events{/privacy}","received_events_url":"https://api.github.com/users/drodri/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T16:40:27Z","updated_at":"2015-05-07T16:40:27Z","body":"Hi Sebastian!\r\n\r\nI have just pushed it to develop (you can use it from source, will be in next release): https://github.com/biicode/client/commit/92d9e4dae729dae6319462b7882bc437d092c776\r\n\r\nTo summarize:\r\n- SYSTEM for deps is enabled by default (it passed all of our integration and regression tests), no need to configure in biicode.conf, handled as a CMake options, which makes sense, you can opt-out with:\r\n```\r\n$ bii configure -DBII_DEPS_SYSTEM=OFF\r\n```\r\n- It works both with relative and absolute includes :)\r\n\r\nIf you try it from source, or when next release is out, could you please tell me if it worked? Thanks!"}}