Portability of #warning preprocessor directive

前端 未结 6 1655
孤独总比滥情好
孤独总比滥情好 2020-11-29 10:47

I know that the #warning directive is not standard C/C++, but several compilers support it, including gcc/g++. But for those that don\'t support it, will t

6条回答
  •  迷失自我
    2020-11-29 11:21

    It is likely that if a compiler doesn't support #warning, then it will issue an error. Unlike #pragma, there is no recommendation that the preprocessor ignore directives it doesn't understand.

    Having said that, I've used compilers on various different (reasonably common) platforms and they have all supported #warning.

提交回复
热议问题