diff options
author | Tomek Mrugalski <tomek@isc.org> | 2012-03-09 11:18:14 +0000 |
---|---|---|
committer | Tomek Mrugalski <tomek@isc.org> | 2012-03-09 11:18:14 +0000 |
commit | dd9237c309ac816268ec395f0d65a18a38a9aa2a (patch) | |
tree | f79ad87307715109fdf0886a70b2c4c5c50a7983 /includes/cdefs.h | |
parent | 9a266235e6813d2565dc48949b222ba8e08078cb (diff) | |
download | isc-dhcp-dd9237c309ac816268ec395f0d65a18a38a9aa2a.tar.gz |
Fixed many compilation problems ("set, but not used" warnings) for
gcc 4.6 that may affect Ubuntu 11.10 users. [ISC-Bugs #27588]
Diffstat (limited to 'includes/cdefs.h')
-rw-r--r-- | includes/cdefs.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/cdefs.h b/includes/cdefs.h index b04e5b58..d5ef422e 100644 --- a/includes/cdefs.h +++ b/includes/cdefs.h @@ -4,7 +4,7 @@ /* * Copyright (c) 1995 RadioMail Corporation. All rights reserved. - * Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2011,2012 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-2003 by Internet Software Consortium * @@ -46,15 +46,25 @@ * the warning by the use of void. In conjunction with the use of -Werror * these warnings prohibit the compilation of the package. This macro * allows us to assign the return value to a variable and then ignore it. + * + * __attribute__((unused)) is added for avoiding another warning about set, + * but unused variable. This is produced by unused-but-set-variable switch + * that is enabled by default in gcc 4.6. */ #if !defined(__GNUC__) || (__GNUC__ < 4) #define IGNORE_RET(x) (void) x #else #define IGNORE_RET(x) \ do { \ - int ignore_return; \ - ignore_return = x; \ + int __attribute__((unused)) ignore_return ;\ + ignore_return = x; \ } while (0) #endif +/* This macro is defined to avoid unused-but-set-variable warning + * that is enabled in gcc 4.6 + */ + +#define IGNORE_UNUSED(x) { x = x; } + #endif /* __ISC_DHCP_CDEFS_H__ */ |