Nmap Development mailing list archives

Re: [nmap-svn] r33802 - in nmap: libnetutil nbase ncat nsock/src


From: Daniel Miller <bonsaiviking () gmail com>
Date: Wed, 12 Nov 2014 23:28:50 -0600

On Wed, Nov 12, 2014 at 4:45 PM, Henri Doreau <henri.doreau () gmail com> wrote:
2014-11-12 14:29 GMT+01:00  <commit-mailer () nmap org>:
Author: dmiller
Date: Wed Nov 12 13:29:40 2014
New Revision: 33802

Log:
Let MSVC know about noreturn attribute to help with code analysis


Hi Dan,

Thanks for this work. What about defining a global, portable
__noreturn macro which would evaluate to either __declspec(noreturn)
or  __attribute__ ((noreturn)) according to the build platform?


Henri,

That sounds good, and I considered it. But at the moment I was just
looking for something quick to reduce the noise in MSVC's code
analyzer. Lua does something similar in llimits.h:

/*
** non-return type
*/
#if defined(__GNUC__)
#define l_noret   void __attribute__((noreturn))
#elif defined(_MSC_VER)
#define l_noret   void __declspec(noreturn)
#else
#define l_noret   void
#endif

Does this look like it would work?

Dan
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: