{"action":"created","issue":{"url":"https://api.github.com/repos/openscad/openscad/issues/329","labels_url":"https://api.github.com/repos/openscad/openscad/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/openscad/openscad/issues/329/comments","events_url":"https://api.github.com/repos/openscad/openscad/issues/329/events","html_url":"https://github.com/openscad/openscad/issues/329","id":13087384,"number":329,"title":"Option to treat warnings as errors when compiling and rendering a .scad file","user":{"login":"brantmerryman","id":1581468,"avatar_url":"https://avatars.githubusercontent.com/u/1581468?v=3","gravatar_id":"","url":"https://api.github.com/users/brantmerryman","html_url":"https://github.com/brantmerryman","followers_url":"https://api.github.com/users/brantmerryman/followers","following_url":"https://api.github.com/users/brantmerryman/following{/other_user}","gists_url":"https://api.github.com/users/brantmerryman/gists{/gist_id}","starred_url":"https://api.github.com/users/brantmerryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantmerryman/subscriptions","organizations_url":"https://api.github.com/users/brantmerryman/orgs","repos_url":"https://api.github.com/users/brantmerryman/repos","events_url":"https://api.github.com/users/brantmerryman/events{/privacy}","received_events_url":"https://api.github.com/users/brantmerryman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2013-04-11T20:24:41Z","updated_at":"2015-01-12T02:32:08Z","closed_at":null,"body":"Currently if you **include** or **use** a file inside of a .scad document, and that file is not found, a warning is generated and the object still renders.\r\n\r\nOften this means that a missing include file can cause holes to be the wrong size.\r\n\r\nTo do:\r\nAdd a compiler flag to treat warnings as errors. This should be something similar to the gcc options:\r\n     * -Werror **treat all warnings as errors**\r\n     * -Werror= *specific error* **treat a specific warning as an error**\r\n     * -Wno-error= *specific error* **treat a specific warning as a warning even when -Werror is in effect**\r\nWe would like to at least cover the case of a missing file.\r\n\r\nAdd a way to specify this inside of the GUI, possibly as a preferences item: \"treat warnings as errors\".\r\n\r\n**Nice to have, but might be too fancy** Add a way to modify the current compiler flags from code - similar to #pragma.\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/218703-option-to-treat-warnings-as-errors-when-compiling-and-rendering-a-scad-file?utm_campaign=plugin&utm_content=tracker%2F52063&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F52063&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/openscad/openscad/issues/comments/69524513","html_url":"https://github.com/openscad/openscad/issues/329#issuecomment-69524513","issue_url":"https://api.github.com/repos/openscad/openscad/issues/329","id":69524513,"user":{"login":"5solids","id":2675209,"avatar_url":"https://avatars.githubusercontent.com/u/2675209?v=3","gravatar_id":"","url":"https://api.github.com/users/5solids","html_url":"https://github.com/5solids","followers_url":"https://api.github.com/users/5solids/followers","following_url":"https://api.github.com/users/5solids/following{/other_user}","gists_url":"https://api.github.com/users/5solids/gists{/gist_id}","starred_url":"https://api.github.com/users/5solids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5solids/subscriptions","organizations_url":"https://api.github.com/users/5solids/orgs","repos_url":"https://api.github.com/users/5solids/repos","events_url":"https://api.github.com/users/5solids/events{/privacy}","received_events_url":"https://api.github.com/users/5solids/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T02:32:08Z","updated_at":"2015-01-12T02:32:08Z","body":"By the way, does anybody know of any way to cause an error that stops the machinery?\r\n\r\nFor the time being, I could live with defining my own module and simply calling that in case I'am not happy with a configuration parameter or similar. For instance:\r\n\r\nmodule exit(rc) {\r\n    echo(str(\"RC: \",rc));\r\n    // something that stop the compiler\r\n}\r\n\r\nif (foo == 23) {\r\n    echo(\"ERROR: invalid foo value\");\r\n    exit(1);\r\n}\r\n\r\nAnother alternative could be an assert() function.\r\n\r\nRegarding checking if an include worked, it might be work around to add a kind of eye-catcher variable in the include file and to check its value after the import. But then again it would be great if we would have a way to programmatically stop the compile."}}