On 20/07/2021 19:57, Thomas Noll via Exim-users wrote:
> Am Montag, 19. Juli 2021, 16:05:39 CEST schrieb Jeremy Harris via Exim-users:
>
>> Yup, known, and only appeared there as a result of pushing constification
>> further through the code. The data items should be readonly, and that
>> has always been the case.
>
> But here
> filter.c:2042:12: warning: assignment discards 'const' qualifier from pointer
> target type [-Wdiscarded-qualifiers]
>
> ---
> fmsg = expargs[0]; /*XXX loses track of const */
> if (Ustrlen(fmsg) > 1024) Ustrcpy(fmsg + 1000, US" ... (truncated)");
> fmsg = US string_printing(fmsg);
> ----
>
> a const value is modified. One could copy the value, but at first sight i'd
> rather drop the const here.
Ouch. To do that you'd have to trace back the const to everywhere
and re-evaluate the semantic assumptions. I suspect that's not viable,
and a copy really has to be done.
>
>> Volunteers welcome (as I keep saying).
>
> Tempting. But i dislike diffs caused by formatting, and i dislike
> manual formatting. So do you have a common formatting tool/config?
No; and (unfortunately) bits of the code having been developed by
different people have different styles. I do regularise where I can
but it's a long struggle.
If you have a preferred tool, use src/exim.c as a template for
developing a config (and add the config to the codebase somewhere!)
--
Cheers,
Jeremy