Martin B.
2010-07-22 19:49:26 UTC
No replies so far, well.
If I would create a patch for this would this be accepted for the next
version? (Duncan mentioned a few weeks ago that 4.1.5 may/will be built
for VS2010)
cheers,
Martin
-------- Original Message --------
Subject: [omniORB] Problem with "// never return" functions and static
code analysis
Date: Fri, 09 Jul 2010 18:18:19 +0200
From: Martin B. <***@gmx.at>
To: OmniORB Support <omniorb-***@omniorb-support.com>
Hi all, Hi Duncan!
I'm currently messing around with Visual Studio 2010 and it's /analysis
feature.
One of the warnings it's got is that it'll tell you when you are
dereferencing a NULL pointer. The problem is now that it will generate
this warning all over the omniORB headers, e.g:
***
[4.1.2, stringtypes.h, ln 219]
inline char& operator[] (_CORBA_ULong index_) {
if (!_data) {
_CORBA_bound_check_error(); // never return
}
return _data[index_];
}
***
This could be solved by tagging all "// never return" functions with
__declspec(noreturn)
for VS Builds. (Obviously via some macro.)
Would it be possible to add something like this?
Should be useful for other compilers / code analysis tools too,
shouldn't it?
cheers,
Martin
If I would create a patch for this would this be accepted for the next
version? (Duncan mentioned a few weeks ago that 4.1.5 may/will be built
for VS2010)
cheers,
Martin
-------- Original Message --------
Subject: [omniORB] Problem with "// never return" functions and static
code analysis
Date: Fri, 09 Jul 2010 18:18:19 +0200
From: Martin B. <***@gmx.at>
To: OmniORB Support <omniorb-***@omniorb-support.com>
Hi all, Hi Duncan!
I'm currently messing around with Visual Studio 2010 and it's /analysis
feature.
One of the warnings it's got is that it'll tell you when you are
dereferencing a NULL pointer. The problem is now that it will generate
this warning all over the omniORB headers, e.g:
***
[4.1.2, stringtypes.h, ln 219]
inline char& operator[] (_CORBA_ULong index_) {
if (!_data) {
_CORBA_bound_check_error(); // never return
}
return _data[index_];
}
***
This could be solved by tagging all "// never return" functions with
__declspec(noreturn)
for VS Builds. (Obviously via some macro.)
Would it be possible to add something like this?
Should be useful for other compilers / code analysis tools too,
shouldn't it?
cheers,
Martin