| | 857 | |
| | 858 | '''Clang''' |
| | 859 | |
| | 860 | Clang supports most GCC warnings, see [http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html] |
| | 861 | |
| | 862 | [http://clang.llvm.org/docs/UsersManual.html#cl_diagnostics] |
| | 863 | |
| | 864 | Clang also supports suppressing warnings by pragmas, see [http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html] |
| | 865 | for example |
| | 866 | |
| | 867 | {{{#pragma clang diagnostic ignored "-Wno-unused-variable"}}} |
| | 868 | |
| | 869 | As with MSVC, it is usually desirable to localize warning suppression by bracketing push'n'pop pragmas. |
| | 870 | Localization is especially important in included .hpp library files to avoid quietly suppressing warnings in user code: |
| | 871 | the user may need to see warnings in his code. A contrived example is: |
| | 872 | |
| | 873 | {{{ |
| | 874 | #pragma clang diagnostic push |
| | 875 | #pragma clang diagnostic ignored "-Wmultichar" |
| | 876 | |
| | 877 | char b = 'df'; // No warning. |
| | 878 | |
| | 879 | #pragma clang diagnostic pop |
| | 880 | }}} |
| | 881 | |
| | 882 | More info needed on Clang. |
| | 883 | |