[PATCH i-g-t] meson: Turn on few warns

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Mar 25 15:47:11 UTC 2024


Hi Bhanuprakash,
On 2024-03-25 at 13:54:22 +0530, Bhanuprakash Modem wrote:
> dangling-pointer:
>     Warn usage of pointers to objects after their lifetime has ended.
> int-conversion:
>     Warn about incompatible integer to pointer and pointer to
>     integer conversions.
> unused-variable:
>     Warn whenever a local or static variable is unused aside from its
>     declaration.
> 
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  meson.build | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index cee8a7446..df062abc3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -57,8 +57,10 @@ cc_args = [
>  
>  	'-Werror=address',
>  	'-Werror=array-bounds',
> +	'-Werror=dangling-pointer',

This looks ok.

>  	'-Werror=implicit',
>  	'-Werror=init-self',
> +	'-Werror=int-conversion',

I do not know why it wasn't included in meson,
looks like pointer conversions are catched by new gcc
with other warning name.

>  	'-Werror=int-to-pointer-cast',
>  	'-Werror=main',
>  	'-Werror=missing-braces',
> @@ -67,6 +69,7 @@ cc_args = [
>  	'-Werror=return-type',
>  	'-Werror=sequence-point',
>  	'-Werror=trigraphs',
> +	'-Werror=unused-variable',

Could you drop this?

Also +cc Petri.

Regards,
Kamil

>  	'-Werror=write-strings',
>  # Disable the memory allocating builtins as they may cause unexpected behavior
>  # with our framework. They *may* get optimized out in favor of a register or
> -- 
> 2.43.2
> 


More information about the igt-dev mailing list