-Wmissing-prototypes warnings in user-mode linux

Tiwei Bie tiwei.btw at antgroup.com
Tue Mar 5 03:18:50 PST 2024


On 3/5/24 6:49 PM, Jani Nikula wrote:
> On Tue, 05 Mar 2024, Johannes Berg <johannes at sipsolutions.net> wrote:
>> On Tue, 2024-03-05 at 12:34 +0200, Jani Nikula wrote:
>>> We're seeing a lot of -Wmissing-prototypes warnings when building
>>> user-mode Linux. For example, our CI hits things like [1], and it's just
>>> extra noise in the build.
>>
>> Yeah ...
>>
>>> I started adding some prototypes, but I lost my way around the arch/
>>> subdirectory a bit. I'm not always quite sure what should or could be
>>> included where, or whether a new header should be added instead, etc.,
>>> so it wasn't going as quickly as I'd hoped.
>>>
>>> Do you perhaps already have plans or, better yet, patches to address
>>> this? Feels like it should be fairly quick for someone familiar with the
>>> arch/um codebase.
>>
>> I think this series addressed most already?
>>
>> https://patchwork.ozlabs.org/project/linux-um/list/?series=393619
>>
>> But I haven't checked myself yet.
> 
> Oh, nice, it certainly helps!
> 
> But after applying that in my branch, I do still get a bunch of
> warnings.

Thanks for raising this topic!                            
                                                              
Indeed. To make it easier to review, the current series only addressed
the -Wmissing-prototypes warnings that can be fixed straightforwardly (e.g.
by turning into static functions or including missing headers). The remaining 
-Wmissing-prototypes warnings mainly fall into the following categories:

- Symbols defined and used in os-Linux/;                
- Symbols defined in os-Linux/, but declared in kernel headers;
- Symbols defined in individual files and not called explicitly;

My plan was to fix the remaining warnings in followup series. Ultimately,
I wish we can let cc treat -Wmissing-prototypes warnings as errors.

Regards,
Tiwei



More information about the linux-um mailing list