Many times I see in open source code that a call to a C function is cast to void.
For example, in the source code for ls
(http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/ls/ls.c) I see the following.
(void) setlocale(LC_ALL, "");
Why is this good practice?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…