comparison src/compiler.h @ 4028:f386b9b92417

[xemacs-hg @ 2007-06-22 17:15:34 by stephent] Try to use UNUSED with more versions of GCC and ICC. <87tzsz52bs.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Fri, 22 Jun 2007 17:15:37 +0000
parents ad2f4ae9895b
children aa5ed11f473b
comparison
equal deleted inserted replaced
4027:c56a675b3b05 4028:f386b9b92417
208 # define ATTRIBUTE_CONST 208 # define ATTRIBUTE_CONST
209 # define CONST_FUNC const 209 # define CONST_FUNC const
210 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ 210 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
211 #endif /* ATTRIBUTE_CONST */ 211 #endif /* ATTRIBUTE_CONST */
212 212
213 /* Unused declarations; g++ and icc do not support this. */
214 /* 213 /*
215 NOTE: These macros MUST be named UNUSED (exactly) or something 214 NOTE: These macros MUST be named UNUSED (exactly) or something
216 prefixed with USED_IF_, or DEFUN docstrings will be parsed incorrectly. 215 prefixed with USED_IF_, or DEFUN docstrings will be parsed incorrectly.
217 See comments in make_docfile.c (write_c_args). You'd think that this 216 See comments in make_docfile.c (write_c_args). You'd think that this
218 wouldn't happen, but unfortunately we do indeed have some arguments 217 wouldn't happen, but unfortunately we do indeed have some arguments
219 of DEFUNs unused for GNU compatibility or because features are missing. 218 of DEFUNs unused for GNU compatibility or because features are missing.
219
220 #### At one time, __attribute__ ((unused)) confused G++. We don't know
221 which versions. Please report problems and fix conditionals.
222 #### A similar issue arose with the Intel CC. We know that v7 didn't
223 work and v9 does. Let us know if v8 works or not, please.
224 See <m34plsmh88.fsf@jerrypc.cs.usu.edu>.
220 */ 225 */
221 #ifndef UNUSED_ARG 226 #ifndef UNUSED_ARG
222 # define UNUSED_ARG(decl) unused_##decl 227 # define UNUSED_ARG(decl) unused_##decl
223 #endif 228 #endif
224 #ifndef UNUSED 229 #ifndef UNUSED
225 # if defined(__GNUC__) && !defined(__cplusplus) && !defined(__INTEL_COMPILER) 230 # if defined(__GNUC__) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 800)
226 # define ATTRIBUTE_UNUSED __attribute__ ((unused)) 231 # define ATTRIBUTE_UNUSED __attribute__ ((unused))
227 # else 232 # else
228 # define ATTRIBUTE_UNUSED 233 # define ATTRIBUTE_UNUSED
229 # endif 234 # endif
230 # define UNUSED(decl) UNUSED_ARG (decl) ATTRIBUTE_UNUSED 235 # define UNUSED(decl) UNUSED_ARG (decl) ATTRIBUTE_UNUSED