In the following code, gcc does not instantiate the NSP::Admin and NSP::Server objects. It just skips them.
int main(int argc, char **argv)
{
// Here we boostrap google logging
// we also install the signal handler
google::InitGoogleLogging(argv[0]);
google::InstallFailureSignalHandler();
// now we parse the arguments with gflags
google::ParseCommandLineFlags(&argc, &argv, true);
NSP::Admin admin();
NSP::server server();
DLOG(INFO) << "boost io_service run";
NSP::IOService::getIOService().run();
}
If I add a parameter to the CTORS they are instantiated. Example :
NSP::Admin admin(1);
NSP::server server(1);
I cannot break point on them with gdb, and stepping skips them. These two objects register themselves with the boost io service and call a method in their CTORS.
NSP is the project namespace.
Using gcc4.2 on FreeBSD, glog, gflags and boost asio.