MSVC equivalent of __attribute__ ((warn_unused_result))?

前端 未结 5 2156
旧时难觅i
旧时难觅i 2020-12-05 23:41

I\'m finding __attribute__ ((warn_unused_result)) to be very useful as a means of encouraging developers not to ignore error codes returned by functions, but I

5条回答
  •  攒了一身酷
    2020-12-06 00:14

    As far as I'm aware, the MS compilers don't have an equivalent pragma or attribute - the only "unused" type warning you can get is for variables when you have the optimizer turned on with the appropriate warning level.

提交回复
热议问题