Add my own compiler warning

前端 未结 5 1399
庸人自扰
庸人自扰 2021-01-03 19:20

When using sprintf, the compiler warns me that the function is deprecated.

How can I show my own compiler warning?

5条回答
  •  悲&欢浪女
    2021-01-03 19:35

    In Visual Studio,

    #pragma message ("Warning goes here")

    On a side note, if you want to suppress such warnings, find the compiler warning ID (for the deprecated warning, it's C4996) and insert this line:

    #pragma warning( disable : 4996)

提交回复
热议问题