How to eliminate the “discard qualifier” warning?

前端 未结 2 469
广开言路
广开言路 2021-01-14 02:25

Using GCC and C99 mode, I have a function declared as:

void func(float *X);

When I call the function, I use a volatile array Y:

<         


        
2条回答
  •  一整个雨季
    2021-01-14 02:51

    No, you can't turn that warning off. It's telling you you're violating the type system. If you want to call func you either need to pass it pointers to non-volatile data or change the function signature to accept pointers to volatile data.

提交回复
热议问题