How to use execv() without warnings?

前端 未结 6 1842
半阙折子戏
半阙折子戏 2021-01-03 07:46

I am working on MacOS-X Lion with GCC 4.2. This code works, but I get a warning I would like fix:

#include 
main()
{
    char *args[] = {\"/b         


        
6条回答
  •  一向
    一向 (楼主)
    2021-01-03 08:29

    The only reason you get the warning is that you're using g++, not gcc. In pure C, you'd get absolutely no warnings. It's actually quite difficult to create warning-free C++ code from this. To be honest, I tried but did not succeed.

    These hurdles are one of the reasons for the existence of a certain philosophical school. See more here.

提交回复
热议问题