In gcc, how to mute the -fpermissive warning?

后端 未结 2 1331
眼角桃花
眼角桃花 2020-12-25 12:53

I am including a file from a third-party library that raises an error that can be downgraded to a warning with -fpermissive. But because I do not want to \"poll

2条回答
  •  旧巷少年郎
    2020-12-25 13:29

    It's maybe a bit late for this, but one of these ought to do what you wanted:

    #pragma GCC diagnostic ignored "-fpermissive"
    

    or

    #pragma GCC diagnostic ignored "-pedantic"
    

    "ignored" is how you squelch a diagnostic entirely, and the inverse of -fpermissive is -pedantic, for historical reasons.

提交回复
热议问题