SunStudio C++ compiler pragma to disable warnings?

前端 未结 4 569
心在旅途
心在旅途 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:33

    In SunStudio 12, the #pragma error_messages work as documented in the C users manual.

    You can see the tags with the -errtags=yes option, and use it like this:

    // Disable badargtypel2w:
    //     String literal converted to char* in formal argument
    #pragma error_messages (off, badargtypel2w )
    

    and then compile with CC (the C++ compiler).

提交回复
热议问题