You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/14 01:36:40 UTC

[GitHub] ccollins476ad opened a new pull request #1025: imgmgr: Prevent `maybe-uninitialized` warning.

ccollins476ad opened a new pull request #1025: imgmgr: Prevent `maybe-uninitialized` warning.
URL: https://github.com/apache/mynewt-core/pull/1025
 
 
   gcc 5.4.1 reports the following warning when `BOOTUTIL_IMAGE_FORMAT_V2` is enabled:
   
   ```
   Error: repos/apache-mynewt-core/mgmt/imgmgr/src/imgmgr.c: In function 'imgr_read_info':
   repos/apache-mynewt-core/mgmt/imgmgr/src/imgmgr.c:202:16: error: 'data_end' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                if (data_off + IMGMGR_HASH_LEN > data_end) {
                   ^
   ```
   
   This is a spurious warning; `data_end` is always initialized at this point.  The fix is to initialize `data_end` to 0 at the start of the function.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services