[En-Nut-Discussion] Any none-byte addressable architecture supported?

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Dec 18 15:39:41 CET 2017


Hello,

trying to compile with the new released arm-none-eabi-gcc V7,
dev/spi_7seg.c gives:
spi_7seg.c:285:17: error: 'memset' used with length equal to number of
                   elements without multiplication by element size
                   [-Werror=memset-elt-size]
                 memset( dcb->digit, 0, SEG7_DIGITS);

with digits defined as
typedef struct {
    uint_fast8_t  digit[SEG7_DIGITS]; /*!< Buffer for Display content */
...

Obviously gcc pinpoints some problem here.

Changing the code to
         memset( dcb->digit, 0, SEG7_DIGITS * sizeof(dcb->digit));

fixes the warning. But i think the usage of uint_fast8_t is only wasting
space. It would only be needed if some of the architectures that NutOS
supports does _not_ support byte addressung. To my knowledge, this is not
the case.

Please correct me if I am wrong.

Thanks
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------


More information about the En-Nut-Discussion mailing list