Message ID | 2505bcd57b2138163bd7540e3534edd403554751.1683724114.git.anand.jain@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: fix warning no previous prototype | expand |
On Wed, May 10, 2023 at 10:01:10PM +0800, Anand Jain wrote: > When compiling on a system with gcc 12.2.1, the following warning is > generated. It can be fixed by adding a static storage class specifier. > > cmds/inspect.c:733:5: warning: no previous prototype for ‘cmp_cse_devid_start’ [-Wmissing-prototypes] > 733 | int cmp_cse_devid_start(const void *va, const void *vb) > | ^~~~~~~~~~~~~~~~~~~ > cmds/inspect.c:754:5: warning: no previous prototype for ‘cmp_cse_devid_lstart’ [-Wmissing-prototypes] > 754 | int cmp_cse_devid_lstart(const void *va, const void *vb) > | ^~~~~~~~~~~~~~~~~~~~ > cmds/inspect.c:775:5: warning: no previous prototype for ‘print_list_chunks’ [-Wmissing-prototypes] > 775 | int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode, > | ^~~~~~~~~~~~~~~~~ > > Signed-off-by: Anand Jain <anand.jain@oracle.com> Added to devel, thanks.
diff --git a/cmds/inspect.c b/cmds/inspect.c index 5623f9913bf1..117efb51674a 100644 --- a/cmds/inspect.c +++ b/cmds/inspect.c @@ -730,7 +730,7 @@ struct list_chunks_ctx { struct list_chunks_entry *stats; }; -int cmp_cse_devid_start(const void *va, const void *vb) +static int cmp_cse_devid_start(const void *va, const void *vb) { const struct list_chunks_entry *a = va; const struct list_chunks_entry *b = vb; @@ -751,7 +751,7 @@ int cmp_cse_devid_start(const void *va, const void *vb) return 1; } -int cmp_cse_devid_lstart(const void *va, const void *vb) +static int cmp_cse_devid_lstart(const void *va, const void *vb) { const struct list_chunks_entry *a = va; const struct list_chunks_entry *b = vb; @@ -772,8 +772,8 @@ int cmp_cse_devid_lstart(const void *va, const void *vb) return 1; } -int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode, - unsigned unit_mode, bool with_usage, bool with_empty) +static int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode, + unsigned unit_mode, bool with_usage, bool with_empty) { u64 devid; struct list_chunks_entry e;
When compiling on a system with gcc 12.2.1, the following warning is generated. It can be fixed by adding a static storage class specifier. cmds/inspect.c:733:5: warning: no previous prototype for ‘cmp_cse_devid_start’ [-Wmissing-prototypes] 733 | int cmp_cse_devid_start(const void *va, const void *vb) | ^~~~~~~~~~~~~~~~~~~ cmds/inspect.c:754:5: warning: no previous prototype for ‘cmp_cse_devid_lstart’ [-Wmissing-prototypes] 754 | int cmp_cse_devid_lstart(const void *va, const void *vb) | ^~~~~~~~~~~~~~~~~~~~ cmds/inspect.c:775:5: warning: no previous prototype for ‘print_list_chunks’ [-Wmissing-prototypes] 775 | int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode, | ^~~~~~~~~~~~~~~~~ Signed-off-by: Anand Jain <anand.jain@oracle.com> --- cmds/inspect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)