[dev] [st] compilation warnings/errors

From: ShellCode <shellcode33_AT_proton.me>
Date: Sat, 12 Nov 2022 19:56:17 +0000

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 _AT_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
Received on Sat Nov 12 2022 - 20:56:17 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 12 2022 - 21:00:09 CET