=== test.c === static volatile char *vp; int main(int argc, char *argv[]) { struct {char *p;} st; /* lock */ st.p = vp; /* unlock */ return 0; } ====== Присвоение st.p = vp; не должно быть оптимизировано компилятором (hint volatile должен действовать). > gcc test.c test.c: In function `main': test.c:9: warning: assignment discards qualifiers from pointer target type Поменять структуру st не могу (сделать volatile char *p;). Привёл к типу: st.p = (char *) vp; > gcc -Wcast-qual test.c test.c: In function `main': test.c:9: warning: cast discards qualifiers from pointer target type Как избежать warning'ов? Заранее спасибо.

Ответ на:
комментарий
от php-coder


Ответ на:
комментарий
от Die-Hard


Ответ на:
комментарий
от wfrr

Ответ на:
комментарий
от Die-Hard

Ответ на:
комментарий
от wfrr

Ответ на:
комментарий
от Die-Hard

Ответ на:
комментарий
от anonymous

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум Си warning: assignment makes integer from pointer without a cast (2016)
- Форум Warnings при использовании basename () (2004)
- Форум warning: char ** -> const char *const * (2014)
- Форум Ошибки компиляции PCmanFM (2011)
- Форум как запускать программу?? (2004)
- Форум assignment makes integer from pointer without a cast (2017)
- Форум копирование строки t в конец строки s. (2005)
- Форум gcc 4 чудит? (2006)
- Форум Установка Freeradius (2006)
- Форум Учебный исходник Си вываливается с Segmentation fault. (2012)