On Mon, Mar 30, 2026 at 01:15:29PM +0800, Kevin J. McCarthy wrote:
> On Sun, Mar 29, 2026 at 05:36:52PM +0200, Rene Kita wrote:
> > What is the general opinion here regarding such compiler flags and how
> > to handle such situations?
> 
> I'm going through these (besides imap_next_word() which I already commented
> about), but as you said, some of these aren't easy fixes.  I think we can
> note them in TODO but shouldn't strive too hard to fix them all now.
> 
> In some cases it's hard to know if the solution wouldn't be worse than
> the cast is right now.

There is another one, static inline char *skip_email_wsp(const char *s),
which I forgot about in my previous mail as I had put some #pragma
around it.

> > mutt_socket.c: In function ‘mutt_conn_find’:
> > mutt_socket.c:311:22: warning: cast discards ‘const’ qualifier from pointer 
> > target type [-Wcast-qual]
> >  311 |   mutt_account_tourl((ACCOUNT*) account, &url, 0);
> 
> The ACCOUNT stuff is a mess that has been on my todo list for a while. The
> fact that they don't have a begin/end lifecycle is just a part of the
> problem.  Would definitely advise ignore this for now at least.

I played around a bit more and unless we are going to make -Wcast-qual a
default warning I don't think it's worth it to fix more warnings coming
from that flag.

If we decide to go all in we should just drop every const where we can't
prove that we adhere to it.

Reply via email to