Nmap Development mailing list archives
Re: NORETURN macro broke compilation on VS 2010
From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 1 Jan 2015 08:34:47 -0600
nnposter, Thanks for the bug report, and for the issue you filed over at Github. I applied your patch in r33894. I'm certain that this was just a mental breakdown on my part, echoing the GNUC form in the VC++ declaration. VS2013 did not complain, so I didn't notice. Dan On Wed, Dec 31, 2014 at 4:42 PM, <nnposter () users sourceforge net> wrote:
The NORETURN macro, as defined in commit 85bb2d3[1] from November 17, seems to be disliked by VS 2010. Specifically, the double parentheses in __declspec((noreturn)) are causing a syntax error whenever the macro is used. Is anybody else experiencing this? Reducing the parentheses to a single pair in the three different include files where the same macro is defined seems to resolve the issue. (Note that this is also the form that was originally discussed in [2].) [1] https://github.com/nmap/nmap/commit/85bb2d388d1fbbf2b7ee010ee9ff2c2868f165d3 [2] http://seclists.org/nmap-dev/2014/q4/204 Cheers, nnposter Patch against r33886 follows: --- nbase/nbase.h.orig 2014-12-29 11:50:01.000000000 -0700 +++ nbase/nbase.h 2014-12-31 13:19:04.622431600 -0700 @@ -374,7 +374,7 @@ #if defined(__GNUC__) #define NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) -#define NORETURN __declspec((noreturn)) +#define NORETURN __declspec(noreturn) #else #define NORETURN #endif --- libnetutil/netutil.h.orig 2014-12-29 11:49:37.000000000 -0700 +++ libnetutil/netutil.h 2014-12-31 13:17:20.102431600 -0700 @@ -165,7 +165,7 @@ #if defined(__GNUC__) #define NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) -#define NORETURN __declspec((noreturn)) +#define NORETURN __declspec(noreturn) #else #define NORETURN #endif --- nsock/src/error.h.orig 2014-12-29 11:50:00.000000000 -0700 +++ nsock/src/error.h 2014-12-31 13:20:59.287231600 -0700 @@ -77,7 +77,7 @@ #if defined(__GNUC__) #define NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) -#define NORETURN __declspec((noreturn)) +#define NORETURN __declspec(noreturn) #else #define NORETURN #endif _______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
_______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Re: NORETURN macro broke compilation on VS 2010 Daniel Miller (Jan 01)