【发布时间】:2010-11-27 06:38:14
【问题描述】:
我有以下功能:
bool Server::ServerInit()
{
// bool listenResult = socket.Listen( (const uint8 *)_LOCAL_HOST, m_iPort );
// if( true == listenResult )
// cout << "Server passive socket listening\n";
// else
// cout << "Server passive socket not listening\n";
//
// return listenResult;
} // ServerInit()
这编译得很好,但是编译器不应该抱怨没有返回语句吗?
编辑 0:GNU g++ 编译器
【问题讨论】:
-
你用的是什么编译器?我用 C4716 大声抱怨你的代码 sn-p 的 Visual C++ 编译器。
-
@TheFuzz:我的抱怨声也相当响亮!
-
我进行了编辑。我正在使用 gnu g++ 编译器
-
@TheFuzz:事实上 g++ 默认不会抱怨。令人惊讶...
-
为什么没有设置为 g++ 的默认设置?
标签: c++ compiler-construction compiler-errors return