Thread: Priority of checking build warnings?

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4,138

    Priority of checking build warnings?

    Code:
    1. overloaded-virtual   clang
    1. potentially-evaluated-expression  clang
    1. free-nonheap-object  GCC
    4. maybe-uninitialized  GCC
    5. unused-const-variable clang
    6. deprecated-declarations GCC and clang
    I am building an MSys2 MinGW64 package that uses either GCC or CLANG to build an C++ wxWidgets package called KICAD.

    I am building it and planning to check the build warnings.
    I am not sure which of the top 3 "number 1" are more important to check. Any advise?

    Edit: I have no plans to check "deprecated-declarations" warnings. So many it would be a waste of my time.

    Tim S.
    Last edited by stahta01; 06-18-2022 at 11:20 AM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,156
    My order, just based on a bit of reading.

    3. overloaded-virtual clang
    c++ overloaded virtual function warning by clang? - Stack Overflow
    It depends what the programmer was trying to achieve.
    Like other shadowing issues where one scope hides another, mostly it's a mistake, but could be intentional.

    2. potentially-evaluated-expression clang
    c++ - What is a potentially-evaluated expression? - Stack Overflow


    1. free-nonheap-object GCC
    Assuming it's not a false positive, this would seem to be an actual bug at run-time.
    Depending how robust your allocator is at freeing unknown pointers, the effect is somewhere between a nop and a crash.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,138
    Thanks, I am now planning to cut out the code generating the warning to a small test case. In the order you suggested.

    The code with warning is not obvious right or wrong to me.
    I hope the small test cases will allow fast testing of ways to get rid of the warnings.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which one has priority ?
    By laurick24i in forum C Programming
    Replies: 1
    Last Post: 04-23-2020, 12:20 PM
  2. p++ and ++p priority
    By h255874 in forum C Programming
    Replies: 6
    Last Post: 09-20-2019, 07:30 AM
  3. Replies: 0
    Last Post: 01-19-2017, 11:05 PM
  4. Priority
    By siavoshkc in forum Windows Programming
    Replies: 1
    Last Post: 01-18-2006, 01:57 AM
  5. Priority Queue :: C++
    By kuphryn in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2002, 08:00 PM

Tags for this Thread