Skip to contentSkip to conversation

HELP WANTED: Fix -Wmissing-prototypes warnings (fwd)

DISCUSSION Julia Lawall 3 participants 3 messages Nov 9, 2018 – Nov 16, 2018

lore
Share & tools
lore
#0 lore raw

For those who want to keep contributing...

julia

---------- Forwarded message ----------
Date: Fri, 9 Nov 2018 18:44:10 +0100
From: Borislav Petkov <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], Greg KH <[email protected]>
Subject: HELP WANTED: Fix -Wmissing-prototypes warnings

Hi all,

gcc has a warning option

-Wmissing-prototypes

which fires when a global function is missing a prototype declaration. This warning is important as it catches cases when that global function's prototype has been changed but its callers haven't been updated. And they should be.

Currently, if enabled, this warning triggers ~1400 times for an allmodconfig build and we would like to have 0 warnings and then add that option to the main Makefile.

So helping out here would be lovely!

And it is very easy to do: you simply build the kernel with W=1:

	make -j<num_cpus+1> W=1 2>w.log

choose one -Wmissing-prototypes warning in the w.log build log and fix it by including the header which has the function prototype. Or you declare the function static. If that function prototype is missing, it needs to be added, of course.

For every function, one should ask oneself, is it better to make the function static and save ourselves the prototype and include file dependency - that would be the preferred solution - or if not possible, should one make the prototype visible by including the proper header so that gcc sees the prototype.

This should be a good exercise for newbies who'd like to get involved into kernel development.

Feel free to ask if there are any questions.

Thanks!

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#1 lore raw
Quoted 40 lines · Julia Lawall

For those who want to keep contributing...

julia

---------- Forwarded message ----------
Date: Fri, 9 Nov 2018 18:44:10 +0100
From: Borislav Petkov <[email protected] <javascript:>>
To: [email protected] <javascript:>, [email protected] <javascript:>
Cc: [email protected] <javascript:>, Greg KH <[email protected] <javascript:>>
Subject: HELP WANTED: Fix -Wmissing-prototypes warnings

Hi all,

gcc has a warning option

-Wmissing-prototypes

which fires when a global function is missing a prototype declaration. This warning is important as it catches cases when that global function's prototype has been changed but its callers haven't been updated. And they should be.

Currently, if enabled, this warning triggers ~1400 times for an allmodconfig build and we would like to have 0 warnings and then add that option to the main Makefile.

So helping out here would be lovely!

And it is very easy to do: you simply build the kernel with W=1:

        make -j<num_cpus+1> W=1 2>w.log 

choose one -Wmissing-prototypes warning in the w.log build log and fix it by including the header which has the function prototype. Or you declare the function static. If that function prototype is missing, it needs to be added, of course.

Quoted 9 lines

For every function, one should ask oneself, is it better to make the function static and save ourselves the prototype and include file dependency - that would be the preferred solution - or if not possible, should one make the prototype visible by including the proper header so that gcc sees the prototype.

This should be a good exercise for newbies who'd like to get involved into kernel development.

Awesome. I'll look into this.

Thanks
Ioannis

Quoted 11 lines

Feel free to ask if there are any questions.

Thanks!

Signature · 4 lines
Regards/Gruss, 
    Boris. 

Good mailing practices for 400: avoid top-posting and trim the reply. 
#2 lore raw

I will also work on it but currently I'm preparing for a Linux admin exam. I will be working on it from 26th.

Quoted 77 lines · On Fri, 16 Nov 2018, 15:29 <[email protected] wrote:
Quoted 38 lines · Julia Lawall

For those who want to keep contributing...

julia

---------- Forwarded message ----------
Date: Fri, 9 Nov 2018 18:44:10 +0100
From: Borislav Petkov <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], Greg KH <[email protected]>
Subject: HELP WANTED: Fix -Wmissing-prototypes warnings

Hi all,

gcc has a warning option

-Wmissing-prototypes

which fires when a global function is missing a prototype declaration. This warning is important as it catches cases when that global function's prototype has been changed but its callers haven't been updated. And they should be.

Currently, if enabled, this warning triggers ~1400 times for an allmodconfig build and we would like to have 0 warnings and then add that option to the main Makefile.

So helping out here would be lovely!

And it is very easy to do: you simply build the kernel with W=1:

        make -j<num_cpus+1> W=1 2>w.log

choose one -Wmissing-prototypes warning in the w.log build log and fix it by including the header which has the function prototype. Or you declare the function static. If that function prototype is missing, it needs to be added, of course.

Quoted 9 lines

For every function, one should ask oneself, is it better to make the function static and save ourselves the prototype and include file dependency - that would be the preferred solution - or if not possible, should one make the prototype visible by including the proper header so that gcc sees the prototype.

This should be a good exercise for newbies who'd like to get involved into kernel development.

Awesome. I'll look into this.

Thanks
Ioannis

Quoted 11 lines

Feel free to ask if there are any questions.

Thanks!

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/65babe95-ab4b-4001-8d70-348482770c00%40googlegroups.com
<https://groups.google.com/d/msgid/outreachy-kernel/65babe95-ab4b-4001-8d70-348482770c00%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.