3 ms·
Have you not seen a warning that appeared frivolous or you disagreed with? Or, as my sibling comment says, might be a harmful construct in some contexts but us
by asveikau 5y ago
Have you not seen a warning that appeared frivolous or you disagreed with? Or, as my sibling comment says, might be a harmful construct in some contexts but used correctly in your example?
Further, the compilers are evolving entities written by mere mortals, with their own bugs, occasional poor decisions, and yes, chances to be corrected over time. If the compiler's authors decide a warning is too noisy and disable it in release X, but random linux distro still uses (X - 0.1), should you fix it for them...?
- jcelerier 5y ago> Have you not seen a warning that appeared frivolous or you disagreed with Sure, and I explicitly -Wno- them in that case. > Further, the compilers are evolving entities written by mere mortals, with their own bugs, occasional poor decisions, and yes, chances to be corrected over time. Yes, but it is still increasing the chances that someone makes a build of your software with code strongly broken due to UB - that is not a chance anyone should ever ever take
- saagarjha 5y agoYou take that chance daily by not prefixing your code with a construct that would make it fail compilation in any other compiler but your special one that solves all UB. You are writing C that other people will compile with their own compilers–sometimes they are going to miss UB, sometimes they'll catch UB that you miss.