Overview
Features
Download
Documentation
Community
Add-Ons & Services

poco_bugcheck usage

A general discussion forum.

poco_bugcheck usage

Postby uho » 30 Sep 2011, 22:30

When using the poco_bugcheck and similar macros in a situation like the following:

int f()
{
if (something)
...
else if(something else)
...

poco_bugcheck();
}

you get a compiler warning C4715: ... not all control paths return a value (in MSVC, probably similar in other compilers)
This could be avoided without having to change any client code by using __declspec(noreturn) (for MSVC, __attribute__ ((noreturn)) for GCC) like this:

#if defined(_MSC_VER)
static void __declspec(noreturn) bugcheck(const char* file, int line);
#else
...
I wonder if this has been intentionally left out?
uho
 
Posts: 1
Joined: 30 Sep 2011, 21:26

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron