[U-Boot] [PATCH] env: suppress a spurious warning with GCC 7.1

Simon Glass sjg at chromium.org
Fri Nov 24 22:36:24 UTC 2017


On 21 November 2017 at 15:29, Philipp Tomsich
<philipp.tomsich at theobroma-systems.com> wrote:
> GCC 7.1 seems to be smart enough to track val through the various
> static inline functions, but not smart enough to see that val will
> always be initialised when no error is returned.  This triggers
> the following warning:
>   env/mmc.c: In function 'mmc_get_env_addr':
>   env/mmc.c:121:12: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> To make it easier for compiler to understand what is going on, let's
> initialise val.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
> ---
>
>  env/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list