warning: pointer of type ‘void *’ used in arithmetic

前端 未结 3 2147
南方客
南方客 2021-02-18 23:09

I am writing and reading registers from a memory map, like this:

//READ
return *((volatile uint32_t *) ( map + offset ));

//WRITE
*((volatile uint32_t *) ( map          


        
3条回答
  •  甜味超标
    2021-02-18 23:36

    If the use of arithmetic on void pointers is really what you want as it is made possible by GCC (see Arithmetic on void- and Function-Pointers) you can use -Wno-pointer-arith to suppress the warning.

提交回复
热议问题