[10/10] meson: Enable warnings to flag missing declarations
diff mbox series

Message ID 20240624192941.22943-11-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Enable -Wmissing-declarations
Related show

Commit Message

Laurent Pinchart June 24, 2024, 7:29 p.m. UTC
A recently introduced typo resulted in a function definition not
matching its declaration. As the problem occurred in libipa, and IPA
modules are loaded dynamically and are linked with lazy symbol
resolution, the problem wasn't caught at build time.

To try and catch future similar issues, enable the
-Wmissing-declarations warning.

Suggested-by: Barnabás Pőcze <pobrn@protonmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

Comments

Kieran Bingham June 24, 2024, 9:45 p.m. UTC | #1
Quoting Laurent Pinchart (2024-06-24 20:29:41)
> A recently introduced typo resulted in a function definition not
> matching its declaration. As the problem occurred in libipa, and IPA
> modules are loaded dynamically and are linked with lazy symbol
> resolution, the problem wasn't caught at build time.
> 
> To try and catch future similar issues, enable the
> -Wmissing-declarations warning.
> 
> Suggested-by: Barnabás Pőcze <pobrn@protonmail.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meson.build b/meson.build
> index 0ef4cdaafd76..2acd8c3e8cfe 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -95,6 +95,7 @@ if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOUR
>  endif
>  
>  common_arguments = [
> +    '-Wmissing-declarations',

I love any opportunity that lets the tools protect us from ourselves...

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>      '-Wshadow',
>      '-include', meson.current_build_dir() / 'config.h',
>  ]
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/meson.build b/meson.build
index 0ef4cdaafd76..2acd8c3e8cfe 100644
--- a/meson.build
+++ b/meson.build
@@ -95,6 +95,7 @@  if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOUR
 endif
 
 common_arguments = [
+    '-Wmissing-declarations',
     '-Wshadow',
     '-include', meson.current_build_dir() / 'config.h',
 ]