|Anonymous | Login||2019-11-18 12:20 MSK|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0029128||Open CASCADE||[OCCT] OCCT:Coding||public||2017-09-20 19:17||2019-07-10 18:56|
|Target Version||[OCCT] 7.4.0||Fixed in Version||[OCCT] 7.4.0|
|Summary||0029128: Cross-platform macro for enabling compiler warnings suppressed by third-party products|
|Description||As mentioned in comment 0028452:0070334, we sometimes have to deal with compiler warnings suppressed by third-party headers included in some OCCT or application source file. As a result, warnings resulted from the source file itself are also suppressed - this results in decreased OCCT/application code quality.|
Quick solution implemented in issue 0028452 is to use #pragma warning(push) before the third-party headers and #pragma warning(pop) right after it. This is a Microsoft-specific solution.
So it is preferred to define a reusable pair of macros for pushing/popping warnings - see "#pragma GCC diagnostic push/pop" available in gcc 4.6+ and similar commands in CLang.
For convenience and work optimization, it is proposed to put these macros to some common header in OCCT to make them available to OCCT-based applications.
|Tags||No tags attached.|
|Test case number|
Sergey, I'm afraid that we cannot create a macro like you proposed. The problem is that you cannot define a macro containing preprocessor directive -- this will not work (preprocessor is one-pass, and # inside a macro is stringizing operator).
It could be possible to put this kind of macros in header file(s), and #include it (them) to trigger the warnings,.. but do we want that?
|With g++ there is the possibility to add an include path with "-isystem" instead of "-I". Then no warnings are printed from those include files.|
|The new headers Standard_WarningsDisable.hxx and Standard_WarningsRestore.hxx implementing this feature have been added within 0029310 and 0029909|
|2017-09-20 19:17||san||New Issue|
|2017-09-20 19:17||san||Assigned To||=> kgv|
|2017-09-20 19:18||san||Relationship added||child of 0028452|
|2017-10-23 09:05||abv||Note Added: 0071691|
|2017-10-23 09:05||abv||Assigned To||kgv => san|
|2017-10-23 09:05||abv||Status||new => feedback|
|2017-10-23 09:10||BenjaminBihler||Note Added: 0071692|
|2019-07-10 18:52||abv||Relationship added||related to 0029310|
|2019-07-10 18:53||abv||Relationship added||related to 0029909|
|2019-07-10 18:56||abv||Note Added: 0085563|
|2019-07-10 18:56||abv||Status||feedback => verified|
|2019-07-10 18:56||abv||Resolution||open => fixed|
|Copyright © 2000 - 2019 MantisBT Team|