[Mesa-dev] [PATCH 01/24] configure.ac: Add CFLAG -Wno-missing-field-initializers

Marek Olšák maraeo at gmail.com
Fri Jun 8 04:05:55 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek


On Tue, Jun 5, 2018 at 7:58 AM, Gert Wollny <gert.wollny at collabora.com>
wrote:

> This warning is misleading: When a struct is partially initialized without
> assigning to the structure members by name, then the remaining fields
> will be zeroed out, and this warning will be issued (if enabled). If, on
> the
> other hand, the partial initialization is done by assigning to named
> members,
> the remaining structure elements may hold random data, but the warning is
> not
> issued. Since in Mesa the first approach to initialize structure elements
> is
> used very often, and it is usually assumed that the remaining elements are
> zeroed out, heeding this warning would be counter-productive.
>
> Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> ---
>  configure.ac | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 02dca4547c..7d71e0ee4e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -301,7 +301,9 @@ AX_CHECK_COMPILE_FLAG([-Wall],
>          [CFLAGS="$CFLAGS
>  AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration],
> [CFLAGS="$CFLAGS -Werror=implicit-function-declaration"])
>  AX_CHECK_COMPILE_FLAG([-Werror=missing-prototypes],
> [CFLAGS="$CFLAGS -Werror=missing-prototypes"])
>  AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes],
> [CFLAGS="$CFLAGS -Wmissing-prototypes"])
> +AX_CHECK_COMPILE_FLAG([-Wno-missing-field-initializers],
>  [CFLAGS="$CFLAGS -Wno-missing-field-initializers"])
>  AX_CHECK_COMPILE_FLAG([-fno-math-errno],
>  [CFLAGS="$CFLAGS -fno-math-errno"])
> +
>  AX_CHECK_COMPILE_FLAG([-fno-trapping-math],
> [CFLAGS="$CFLAGS -fno-trapping-math"])
>  AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
>  [VISIBILITY_CFLAGS="-fvisibility=hidden"])
>
> --
> 2.16.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180608/f509858c/attachment.html>


More information about the mesa-dev mailing list