SunStudio C++ compiler pragma to disable warnings?

前端 未结 4 571
心在旅途
心在旅途 2021-01-21 04:01

The STLport bundled with the SunStudio11 generates alot of warnings. I beleive most compilers have a way to disable warnings from certain source files, like this:

Sun C<

4条回答
  •  醉酒成梦
    2021-01-21 04:26

    If you'd rather use a command line option than #pragmas, a simple answer is that you can use -erroff=%all on your compile line.

    You can suppress specific warning messages with -erroff=%tag

    You can print out the tags for the warning messages by adding -errtags to your compile line. You can then define a set of comma-separated values for -erroff that suppress just those tags.

    See http://docs.oracle.com/cd/E19205-01/820-7599/bkapa/index.html for more info.

    Note that Sun Studio 12 update 1 is now available, and I'm referencing the SS12u1 doc here.

提交回复
热议问题