Hey everyone,

I started using st (thanks a lot for your work by the way) and applied some 
patches.
When I applied the externalpipe patch, and recompiled st, I noticed some 
warnings were emitted by my compiler. I'm not a 100% sure (i'm not familiar 
with this code) but I feel like there's a bug at the 58th line of this patch : 
https://st.suckless.org/patches/externalpipe/st-externalpipe-0.8.4.diff

lastpos = MIN(tlinelen(n) + 1, term.col) - 1;

is probably meant to be

lastpos = MIN(tlinelen(bp) + 1, term.col) - 1;


If I am not mistaken, this was really easy to spot if the author paid attention 
to the warnings emitted by its compiler (no blame intended, it is even possible 
that its toolchain didn't see it, I guess that's what happens when you use 
obscur underground compilers ;D).

So it made me wonder, what are your thoughts on passing -Werror by default to 
the compiler ? And what about -Wall and -Wextra ?

I do realise these are somehow compiler-dependent flags, but I believe there 
are widely supported by most common compilers and their added value is 
enormous, especially when you care about quality software like you do @suckless.

I enabled -Wall -Wextra to see what would happen, and a dozen of warnings were 
emitted in st (with all the patches applied). Most of them really don't matter 
that much, they are mostly about unused variables, different signedness 
comparisons and so on. But still. I feel like any quality software should pay 
attention to those.

Thanks for reading me, let me know what you think.

ShellCode

Reply via email to