<bdo id='3Vrrt'></bdo><ul id='3Vrrt'></ul>

<small id='3Vrrt'></small><noframes id='3Vrrt'>

    1. <i id='3Vrrt'><tr id='3Vrrt'><dt id='3Vrrt'><q id='3Vrrt'><span id='3Vrrt'><b id='3Vrrt'><form id='3Vrrt'><ins id='3Vrrt'></ins><ul id='3Vrrt'></ul><sub id='3Vrrt'></sub></form><legend id='3Vrrt'></legend><bdo id='3Vrrt'><pre id='3Vrrt'><center id='3Vrrt'></center></pre></bdo></b><th id='3Vrrt'></th></span></q></dt></tr></i><div id='3Vrrt'><tfoot id='3Vrrt'></tfoot><dl id='3Vrrt'><fieldset id='3Vrrt'></fieldset></dl></div>
      <tfoot id='3Vrrt'></tfoot>

      1. <legend id='3Vrrt'><style id='3Vrrt'><dir id='3Vrrt'><q id='3Vrrt'></q></dir></style></legend>

        选择性地仅对翻译单元的一部分禁用 GCC 警告

        时间:2023-09-19
        <tfoot id='NsTVn'></tfoot>
        <i id='NsTVn'><tr id='NsTVn'><dt id='NsTVn'><q id='NsTVn'><span id='NsTVn'><b id='NsTVn'><form id='NsTVn'><ins id='NsTVn'></ins><ul id='NsTVn'></ul><sub id='NsTVn'></sub></form><legend id='NsTVn'></legend><bdo id='NsTVn'><pre id='NsTVn'><center id='NsTVn'></center></pre></bdo></b><th id='NsTVn'></th></span></q></dt></tr></i><div id='NsTVn'><tfoot id='NsTVn'></tfoot><dl id='NsTVn'><fieldset id='NsTVn'></fieldset></dl></div>
            <bdo id='NsTVn'></bdo><ul id='NsTVn'></ul>
              <tbody id='NsTVn'></tbody>

            1. <small id='NsTVn'></small><noframes id='NsTVn'>

                  <legend id='NsTVn'><style id='NsTVn'><dir id='NsTVn'><q id='NsTVn'></q></dir></style></legend>

                  本文介绍了选择性地仅对翻译单元的一部分禁用 GCC 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  与此 MSVC 预处理器代码最接近的 GCC 是什么?>

                  What's the closest GCC equivalent to this MSVC preprocessor code?

                  #pragma warning( push )                    // Save the current warning state.
                  #pragma warning( disable : 4723 )          // C4723: potential divide by 0
                  // Code which would generate warning 4723.
                  #pragma warning( pop )                     // Restore warnings to previous state.
                  

                  我们在通常包含的标头中有代码,我们不想为其生成特定警告.但是,我们希望包含这些标头的文件继续生成该警告(如果项目启用了该警告).

                  We have code in commonly included headers which we do not want to generate a specific warning for. However, we want files which include those headers to continue to generate that warning (if the project has that warning enabled).

                  推荐答案

                  这是 自 4.6 版起可在 GCC 中,或在 2010 年 6 月左右在主干中.

                  This is possible in GCC since version 4.6, or around June 2010 in the trunk.

                  这是一个例子:

                  #pragma GCC diagnostic push
                  #pragma GCC diagnostic error "-Wuninitialized"
                      foo(a);         /* error is given for this one */
                  #pragma GCC diagnostic push
                  #pragma GCC diagnostic ignored "-Wuninitialized"
                      foo(b);         /* no diagnostic for this one */
                  #pragma GCC diagnostic pop
                      foo(c);         /* error is given for this one */
                  #pragma GCC diagnostic pop
                      foo(d);         /* depends on command line options */
                  

                  这篇关于选择性地仅对翻译单元的一部分禁用 GCC 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:解开 std::type_info::name 的结果 下一篇:gcc 优化标志 -O3 使代码比 -O2 慢

                  相关文章

                  最新文章

                1. <i id='KudEh'><tr id='KudEh'><dt id='KudEh'><q id='KudEh'><span id='KudEh'><b id='KudEh'><form id='KudEh'><ins id='KudEh'></ins><ul id='KudEh'></ul><sub id='KudEh'></sub></form><legend id='KudEh'></legend><bdo id='KudEh'><pre id='KudEh'><center id='KudEh'></center></pre></bdo></b><th id='KudEh'></th></span></q></dt></tr></i><div id='KudEh'><tfoot id='KudEh'></tfoot><dl id='KudEh'><fieldset id='KudEh'></fieldset></dl></div>

                  <small id='KudEh'></small><noframes id='KudEh'>

                  • <bdo id='KudEh'></bdo><ul id='KudEh'></ul>

                  1. <tfoot id='KudEh'></tfoot>
                    <legend id='KudEh'><style id='KudEh'><dir id='KudEh'><q id='KudEh'></q></dir></style></legend>