do while 后面要加分号,你大爷的

do
{
    //do something  
} while (0)

TSfree(url);

这个TSFree 正好是个宏,然后编译就提示错误:

error: expected ‘;’ before ‘_TSfree’
 #define TSfree(p) _TSfree(p)
                   ^xyzabc.cc:212:2: note: in expansion of macro ‘TSfree’
  TSfree(url);
  ^

分析N久才发现,原来 do while 后面要加分号。

C 语言用了这么多年,还真是没有注意过这个细节。

原文地址:https://www.cnblogs.com/elodio/p/4818434.html