Remove #pragma once warnings

前端 未结 2 710
死守一世寂寞
死守一世寂寞 2020-12-16 04:59

I am using #pragma once in my .cpps and .hpps and because of that I get a warning for each file that uses it. I have not found any opt

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-16 05:28

    Indeed the #ifndef guard can always be used, but just to remove the warning while compiling the source which uses #pragma once I would recommend to use the -woption while compiling.

    e.g. gcc -w -o

提交回复
热议问题