public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Intel Edison build warning
@ 2017-11-24  8:06 Bin Meng
  2017-11-24 15:42 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Meng @ 2017-11-24  8:06 UTC (permalink / raw)
  To: u-boot

Hi,

Intel Edison has a build warning below.

+  *env_addr = offset;
+            ^
w+../env/mmc.c: In function 'mmc_get_env_addr':
w+../env/mmc.c:121:12: warning: 'val' may be used uninitialized in
this function [-Wmaybe-uninitialized]

I did not figure out what is wrong here. v2017.11 does not have such
build warning.

Do you have any idea?

Regards,
Bin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Intel Edison build warning
  2017-11-24  8:06 [U-Boot] Intel Edison build warning Bin Meng
@ 2017-11-24 15:42 ` Andy Shevchenko
  2017-11-24 15:56   ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2017-11-24 15:42 UTC (permalink / raw)
  To: u-boot

On Fri, 2017-11-24 at 16:06 +0800, Bin Meng wrote:
> Hi,
> 
> Intel Edison has a build warning below.
> 
> +  *env_addr = offset;
> +            ^
> w+../env/mmc.c: In function 'mmc_get_env_addr':
> w+../env/mmc.c:121:12: warning: 'val' may be used uninitialized in
> this function [-Wmaybe-uninitialized]
> 
> I did not figure out what is wrong here. v2017.11 does not have such
> build warning.
> 
> Do you have any idea?

I can't reproduce.

What I did:

% git remote update -p
Fetching origin

% git checkout origin/master

% git clean -xdf

% make W=2 edison_defconfig

% make W=2 -j1

% touch env/mmc.c

% make W=2 -j1

No warnings WRT env/mmc.c at all.

% gcc --version

gcc (Debian 7.2.0-16) 7.2.0

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Intel Edison build warning
  2017-11-24 15:42 ` Andy Shevchenko
@ 2017-11-24 15:56   ` Andy Shevchenko
  2017-11-27  2:34     ` Bin Meng
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2017-11-24 15:56 UTC (permalink / raw)
  To: u-boot

On Fri, 2017-11-24 at 17:42 +0200, Andy Shevchenko wrote:
> On Fri, 2017-11-24 at 16:06 +0800, Bin Meng wrote:
> > Hi,
> > 
> > Intel Edison has a build warning below.
> > 
> > +  *env_addr = offset;
> > +            ^
> > w+../env/mmc.c: In function 'mmc_get_env_addr':
> > w+../env/mmc.c:121:12: warning: 'val' may be used uninitialized in
> > this function [-Wmaybe-uninitialized]
> > 
> > I did not figure out what is wrong here. v2017.11 does not have such
> > build warning.
> > 
> > Do you have any idea?

Somewhat compiler goes crazy?

I have a theory that instead of showing actual potential issues (which
are bogus anyway) it complains on __weak function instead.

The real complains might be env_mmc_load() / env_mmc_save() where
offset* is uninitialized indeed.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Intel Edison build warning
  2017-11-24 15:56   ` Andy Shevchenko
@ 2017-11-27  2:34     ` Bin Meng
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2017-11-27  2:34 UTC (permalink / raw)
  To: u-boot

Hi Andy,

On Fri, Nov 24, 2017 at 11:56 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Fri, 2017-11-24 at 17:42 +0200, Andy Shevchenko wrote:
>> On Fri, 2017-11-24 at 16:06 +0800, Bin Meng wrote:
>> > Hi,
>> >
>> > Intel Edison has a build warning below.
>> >
>> > +  *env_addr = offset;
>> > +            ^
>> > w+../env/mmc.c: In function 'mmc_get_env_addr':
>> > w+../env/mmc.c:121:12: warning: 'val' may be used uninitialized in
>> > this function [-Wmaybe-uninitialized]
>> >
>> > I did not figure out what is wrong here. v2017.11 does not have such
>> > build warning.
>> >
>> > Do you have any idea?
>
> Somewhat compiler goes crazy?
>
> I have a theory that instead of showing actual potential issues (which
> are bogus anyway) it complains on __weak function instead.
>
> The real complains might be env_mmc_load() / env_mmc_save() where
> offset* is uninitialized indeed.
>

Thanks for the testing. I was using GCC 5.4.0 for the build testing
which is the default one shipped in Ubuntu 16.04 LTS. I will try to
find another version to test.

Regards,
Bin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-27  2:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24  8:06 [U-Boot] Intel Edison build warning Bin Meng
2017-11-24 15:42 ` Andy Shevchenko
2017-11-24 15:56   ` Andy Shevchenko
2017-11-27  2:34     ` Bin Meng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox