Intermediate pointers in cast must be “const qualified” - why?
问题 In the following code... #include <stdlib.h> #include <stdint.h> extern void get_buffer_from_HW_driver(volatile uint32_t **p); void getBuffer(volatile uint32_t **pp) { // Write an address into pp, that is obtained from a driver // The underlying HW will be DMA-ing into this address, // so the data pointed-to by the pointer returned by this // call are volatile. get_buffer_from_HW_driver(pp); } void work() { uint32_t *p = NULL; getBuffer((volatile uint32_t **)&p); } ...the compiler rightfully