Need for prefixing a function with (void)

前端 未结 6 1892
一向
一向 2020-12-03 23:32

I recently came across a rather unusual coding convention wherein the call for a function returning \"void\" is prefixed with (void).

e.g.

(void)         


        
6条回答
  •  孤城傲影
    2020-12-04 00:03

    Has it got any advantage or is it yet another needless but there coding convention of some sort?

    No difference. It is a quite common convention e.g. in software testing to highlight the fact that in context the function return, if any, is safe to be discarded.

提交回复
热议问题