Menu

#1176 Fix Linux GCC 11.1.0 warning

Undefined
open
nobody
None
Bug_Report
2022-01-24
2022-01-17
No

When using the CodeBlocks_wx30-unix.workspace to build on Linux using GCC 11.1 there are a HUGE amount of warning. These warning slow the overall build down so it took me 189 minutes out of the box with no changes.

The build time can be reduced to about 6 minutes be doing one of the following:
1) In all of the "unix.cbp" project files change the following compiler option:
<add option="-Wall">
to
<add option="-w">
BUT this has a major side affect in that all warnings are hidden including warning in the C::B code. So this option is not good.
2) As per killerbot's post https://forums.codeblocks.org/index.php/topic,15210.msg169154.html#msg169154 you can modify (aka hack) the wx-config to change the "-I" directory include options to "-isystem" include option. This is better option, but it does mean that you need to modify a wx widget file, but it does mean that now you can fix the C::B source code warnings and be able to build C::B in just over 6 minutes.</add></add>

If neither of the options above are included then there are a HUGE number of wxWidget warnings. These may be fixed in a future release for Unix, but this may take a while to propagate and in the mean time the C::B warning should be fixed.

Discussion

  • bluehazzard

    bluehazzard - 2022-01-17

    BUT this has a major side affect in that all warnings are hidden including warning in the C::B code.

    that's a no go for me...

     
  • Lieven de Cock

    Lieven de Cock - 2022-01-19

    -isystem : why would that not be acceptable ?

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-01-19

    I do not use GCC11, but probably just removing -Wextra (see ticket [#1181]) is enough. For me this reduced warnings from thousands to about thirty (gch related).

     

    Related

    Tickets: #1181

  • Lieven de Cock

    Lieven de Cock - 2022-01-24

    but that is the thing we do not want to do, -Wextra is there to increase the warning level and catch mistakes, disabling it all is like sticking our head in the ground and throw away all the benefits.

    the -isystem will just shut up those warnings on headers from that include path

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.