diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-11-22 01:29:40 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-11-30 06:36:58 +0300 |
commit | fd374665c9b724bb3eb0da32db0bb7ecc5cf1337 (patch) | |
tree | bf80b3bb1154cd9f6194cc383f9f8b86fdf4e9b7 | |
parent | 9bd76b807636599712b4f932da9b57d5d3e8fad4 (diff) | |
download | u-boot-fd374665c9b724bb3eb0da32db0bb7ecc5cf1337.tar.xz |
env: suppress a spurious warning with GCC 7.1
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@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | env/mmc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -73,7 +73,7 @@ static inline s64 mmc_offset(int copy) .partition = "u-boot,mmc-env-partition", .offset = "u-boot,mmc-env-offset", }; - s64 val, defvalue; + s64 val = 0, defvalue; const char *propname; const char *str; int err; |