Re: [PATCH] maint: convert remove a K&R declaration
From:
Collin Funk
Subject:
Re: [PATCH] maint: convert remove a K&R declaration
Date:
Mon, 17 Nov 2025 12:23:58 -0800
User-agent:
Gnus/5.13 (Gnus v5.13)
Pádraig Brady <P@draigBrady.com> writes:
> On 17/11/2025 01:08, Collin Funk wrote:
>> This function is hidden unless EVAL_TRACE is defined for debugging.
>> * src/expr.c (trace): Convert to a prototype instead of K&R
>> definition
>> to avoid -Werror=strict-prototypes. Make the argument const to avoid
>> -Werror=discarded-qualifiers.
>> ---
>> src/expr.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>> diff --git a/src/expr.c b/src/expr.c
>> index 17a1ddd29..980f8e518 100644
>> --- a/src/expr.c
>> +++ b/src/expr.c
>> @@ -552,8 +552,7 @@ require_more_args (void)
>> /* Print evaluation trace and args remaining. */
>> static void
>> -trace (fxn)
>> - char *fxn;
>> +trace (char const *fxn)
>> {
>> char **a;
>>
>
> I see manywarnings in gnulib avoids adding -Wdiscarded-qualifiers,
> though should add -Wstrict-prototypes. Why wasn't it flagged before.
>
> Anyway +1 to the change.
The function only showed up if you had EVAL_TRACE defined. I guess no
one had to debug changes to expr in a long time.
Collin