void cast of argc and argv

前端 未结 4 1152
甜味超标
甜味超标 2021-02-07 13:19

I\'m looking at a piece of C++ code, and the first line in the main function caught my attention:

int main(int argc, const char* argv[]) {
    (void)argc; (void)         


        
4条回答
  •  醉酒成梦
    2021-02-07 13:58

    If you set -Werror option, the compiler makes all warnings into errors, stopping compilation. It's a good practice set -Wall -Werror to check all inconsistences.

提交回复
热议问题