Hi Quentin,

Quentin Rameau writes:
Those don't “cast away constantness”, they are just cast.

Hmm? For example, for the FC/Xft types, fontname is declared as const by xfont_create, but then we cast away its constness when passing it to FCNameParse. The same goes for text, which we claim is const in the drw_font_getexts signature, but then we remove its constness.

In general the existing code seems confused, no? Either we shouldn't pass them in as const in the first place, or we should maintain the constness that we declare in the function parameters.

There shouldn't be any logical change here, but it seems weird to say things are not mutable up front and then waver about it later. Right now there's no UB, but making sure we don't cast away the const mitigates the risk altogether.

Reply via email to