[OE-core] [PATCH] mdadm: fix gcc8 maybe-uninitialized/format-overflow warning

Adrian Bunk bunk at stusta.de
Fri Mar 15 10:45:52 UTC 2019


On Tue, Mar 12, 2019 at 05:41:58PM +0800, changqing.li at windriver.com wrote:
> From: Changqing Li <changqing.li at windriver.com>
> 
> while compiled with -Werror=maybe-uninitialized/-Werror=format-overflow=,
> it failed
> 
> [snip]
> | Incremental.c: In function 'Incremental_container':
> | Incremental.c:1593:3: error: 'mdfd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> | close(mdfd);
> | ^~~~~~~~~~~
> 
> [snip]
> super-intel.c: In function 'apply_takeover_update':
> | super-intel.c:9615:15: error: '%d' directive writing between 1 and 11 bytes into a region of size 7 [-Werror=format-overflow=]
> | " MISSING_%d", du->index);
> | ^~
>...

I am seeing these warnings only with -Og, are you also seeing them with
-Og (DEBUG_OPTIMIZATION) only?

If this is true, I would consider 
https://sources.debian.org/src/mdadm/4.1-2/debian/patches/debian-no-Werror.diff/
a better workaround.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



More information about the Openembedded-core mailing list