Fix -Wmissing-prototypes warnings#129
Open
fabio-porcedda wants to merge 2 commits intorhboot:mainfrom
Open
Conversation
fabio-porcedda
commented
Nov 12, 2025
- Fix -Wmissing-prototypes warnings
- Add to Make.defaults -Wmissing-prototypes -Wstrict-prototypes flags
On my build code size decreased from 129802 to 127183 bytes (-2%).
Add missing static attributes and includes in order to fix
-Wmissing-prototypes warnings:
pe_begin.c:130:1: warning: no previous prototype for ‘__libpe_read_mmapped_file’ [-Wmissing-prototypes]
130 | __libpe_read_mmapped_file(int fildes, void *map_address, size_t maxsize,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cms_common.c:1151:1: warning: no previous prototype for ‘encode_algorithm_id’ [-Wmissing-prototypes]
1151 | encode_algorithm_id(cms_context *cms, SECItem *der, SECOidTag tag)
| ^~~~~~~~~~~~~~~~~~~
cms_common.c:1630:1: warning: no previous prototype for ‘generate_name’ [-Wmissing-prototypes]
1630 | generate_name(cms_context *cms, SECItem *der, CERTName *certname)
| ^~~~~~~~~~~~~
signed_data.c:50:1: warning: no previous prototype for ‘free_algorithm_list’ [-Wmissing-prototypes]
50 | free_algorithm_list(cms_context *cms UNUSED,
| ^~~~~~~~~~~~~~~~~~~
signed_data.c:126:1: warning: no previous prototype for ‘generate_signerInfo_list’ [-Wmissing-prototypes]
126 | generate_signerInfo_list(cms_context *cms, SpcSignerInfo ***signerInfo_list_p, SignerInfoType type)
| ^~~~~~~~~~~~~~~~~~~~~~~~
util.c:15:1: warning: no previous prototype for ‘set_up_global_constants’ [-Wmissing-prototypes]
15 | set_up_global_constants(void)
| ^~~~~~~~~~~~~~~~~~~~~~~
efikeygen.c:506:1: warning: no previous prototype for ‘SEC_ASN1EncodeLongLong’ [-Wmissing-prototypes]
506 | SEC_ASN1EncodeLongLong(PRArenaPool *poolp, SECItem *dest,
| ^~~~~~~~~~~~~~~~~~~~~~
efikeygen.c:638:1: warning: no previous prototype for ‘popt_callback’ [-Wmissing-prototypes]
638 | popt_callback(poptContext con UNUSED,
| ^~~~~~~~~~~~~
pesigcheck.c:351:1: warning: no previous prototype for ‘callback’ [-Wmissing-prototypes]
351 | callback(poptContext con UNUSED,
| ^~~~~~~~
file_kmod.c:17:1: warning: no previous prototype for ‘kmod_generate_digest’ [-Wmissing-prototypes]
17 | kmod_generate_digest(cms_context *cms, unsigned char *addr, size_t len)
| ^~~~~~~~~~~~~~~~~~~~
file_kmod.c:60:1: warning: no previous prototype for ‘kmod_write_signature’ [-Wmissing-prototypes]
60 | kmod_write_signature(cms_context *cms, int outfd)
| ^~~~~~~~~~~~~~~~~~~~
file_kmod.c:115:1: warning: no previous prototype for ‘kmod_write_sig_info’ [-Wmissing-prototypes]
115 | kmod_write_sig_info(cms_context *cms, int fd, uint32_t sig_len)
| ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
In order to avoid new -Wmissing-prototypes and -Wstrict-prototypes warnings add them to Make.defaults. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.