volatile char* sevensegment_char_value;
void ss_load_char(volatile char *digits) {
...
int l=strlen(digits);
...
}
ss_load_char(sevensegment_char_value);
在上面的例子中,我收到了来自 avr-gcc 编译器的警告
Warning 6 passing argument 1 of 'strlen' discards 'volatile' qualifier from pointer target type [enabled by default]
所以我必须以某种方式将值从 volatile 复制到 non-volatile var?什么是安全的解决方法?