Re: [PATCH] tools/testing/vma: Fix function parameter declarations for GCC 8.3 compatibility
From: Vlastimil Babka
Date: Thu Jul 31 2025 - 14:14:10 EST
On 7/31/25 12:24, Lorenzo Stoakes wrote:
> On Thu, Jul 31, 2025 at 10:55:32AM +0800, WangYuli wrote:
>> >
>> Thanks for the heads-up! I noticed that coding style in the kernel code as
>> well.
>>
>> However, GCC 8.3 (which does meet the kernel's compiler version
>> requirements) can compile the kernel code normally, but it can't compile
>> vma's test correctly.
>>
>> Could the issue be related to differences in compilation parameters? I'll
>> need to spend some time looking into this more closely...
>
> OK thanks please do check, am happy to have a patch to add a flag if
> appropriate! :)
>
>>
>> By the way, this coding style has been a GNU C extension until the ISO C23
>> standard. So, until the kernel's C language standard is upgraded to C23
>> (which seems unlikely to happen anytime soon, perhaps years down the line),
>> it actually makes sense to modify this style for a practical purpose...
>
> Kernel always uses the GNU C standard by convention, so we should be good,
> but indeed I think this is the case!
I think it's not "by convention" but quite explicitly by:
Makefile:KBUILD_CFLAGS += -std=gnu11
I think this is not automatically used by tools/ build?
If you git grep gnu11, you'll find various Makefile's under tools/ adding
that to CFLAGS. Maybe we can simply do that also with
tools/testing/shared/shared.mk
that's included for the vma tests.
I don't have this gcc version so can't try myself if it helps.
> The irony here is that I actually intend to change stubs in this header to
> remove parameter names (previously had review on this :).
>
>>
>> [ Cc the kbuild list. ]
>
> Thanks
>
>>
>> Thanks,
>>
>> --
>> WangYuli
>
> Cheers, Lorenzo