andrzej-kaczmarek opened a new pull request #2133: sys/stats: Fix build with 
GCC 9.2.1
URL: https://github.com/apache/mynewt-core/pull/2133
 
 
   This fixes following build error:
   
   Compiling repos/apache-mynewt-core/sys/stats/full/src/stats.c
   Error: In function 'stats_init',
       inlined from 'stats_module_init_internal' at 
repos/apache-mynewt-core/sys/stats/full/src/stats.c:148:10:
   repos/apache-mynewt-core/sys/stats/full/src/stats.c:298:5: error: 'memset' 
offset [13, 16] from the object
   at 'g_stats_stats' is out of the bounds of referenced subobject 's_hdr' with 
type 'struct stats_hdr'
   at offset 0 [-Werror=array-bounds]
     298 |     memset((uint8_t *)shdr + offset, 0, size * cnt);
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
   
   I do not really like that we have separate macros for retrieving const
   and non-const data pointer, but I do not see any easy way to workaround
   this except for removing consts explicitly which basically original
   private API did by casting to uint8_t*.

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


With regards,
Apache Git Services

Reply via email to