Closed Bug 1443402 Opened 2 years ago Closed 2 years ago

Fix some -Wmissing-prototypes warnings in layout


(Core :: Layout, enhancement, P5)




Tracking Status
firefox58 --- wontfix
firefox59 --- wontfix
firefox60 --- fixed


(Reporter: cpeterson, Assigned: cpeterson)


(Blocks 1 open bug)



(1 file)

-Wmissing-prototypes is a new optional warning available in clang ToT. It warns about global functions that have no previous function declaration (e.g. from an #included header file). These functions can probably be made static (allowing the compiler to better optimize them) or they may be unused.

Confusingly, clang's -Wmissing-prototypes is equivalent to gcc's -Wmissing-declarations, not gcc's -Wmissing-prototypes. A function prototype is a function declaration that specifies the function's argument types. C++ requires that all function declarations specify their argument types, but C does not. As such, gcc's -Wmissing-prototypes is a C-only warning about C functions that have no previous function *prototypes* (with argument types), even if a previous function *declaration* (without argument types) was seen.

We won't be able to enable -Wmissing-prototypes warnings by default for a long time because there are still about a thousand warnings remaining. We should also wait until this warning to ride from clang ToT to Xcode's clang.
Comment on attachment 8956349 [details]
Bug 1443402 - Fix some -Wmissing-prototypes warnings in layout.

Seems fine! r=me
Attachment #8956349 - Flags: review?(dholbert) → review+
Comment on attachment 8956349 [details]
Bug 1443402 - Fix some -Wmissing-prototypes warnings in layout.

::: commit-message-709ea:1
(Diff revision 1)
> +Bug 1443402 - Fix some -Wmissing-prototypes warnings in layout. r?dholbert

Oh, just noticed one non-crucial nit: you should probably mention clang in the first line.

e.g. maybe "Fix some clang -Wmissing-prototypes warnings in layout"

Since: as you note further down, "-Wmissing-prototypes" means something completely different in clang vs. gcc, so it's helpful to add a few extra characters to make it clear which flavor you're talking about.
Pushed by
Fix some -Wmissing-prototypes warnings in layout. r=dholbert
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Blocks: 536427
You need to log in before you can comment on or make changes to this bug.