summaryrefslogtreecommitdiff
path: root/lib/warn-on-use.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-05-11 17:28:23 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-05-11 17:54:23 -0700
commit00f0ad55cd7cbb71e42de0d52b7607ffb6a3c220 (patch)
treec7ea55a573abdb8a1583d59ca38ef035e33978f7 /lib/warn-on-use.h
parentdd0b910f1a9d08e65f59cc7ebc10fb6cd0fecfc9 (diff)
downloademacs-00f0ad55cd7cbb71e42de0d52b7607ffb6a3c220.tar.gz
Update from gnulib
This incorporates: 2020-05-11 careadlinkat: fix GCC 10 workaround 2020-05-10 careadlinkat: limit GCC workaround 2020-05-10 attribute: clarify list of attributes 2020-05-10 string: fix compilation error in C++ mode 2020-05-09 manywarnings: port to GCC 10.1 2020-05-09 careadlinkat: pacify -Wreturn-local-addr 2020-05-09 attribute: remove ATTRIBUTE_DEPRECATED 2020-05-09 attribute: Add comments * lib/attribute.h, lib/careadlinkat.c, lib/string.in.h: * lib/warn-on-use.h, m4/manywarnings.m4: Copy from Gnulib.
Diffstat (limited to 'lib/warn-on-use.h')
-rw-r--r--lib/warn-on-use.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h
index 1be2cbb9570..23c10fdd122 100644
--- a/lib/warn-on-use.h
+++ b/lib/warn-on-use.h
@@ -100,23 +100,28 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
#endif
/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
- is like _GL_WARN_ON_USE (function, "string"), except that the function is
- declared with the given prototype, consisting of return type, parameters,
- and attributes.
+ is like _GL_WARN_ON_USE (function, "string"), except that in C++ mode the
+ function is declared with the given prototype, consisting of return type,
+ parameters, and attributes.
This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
not work in this case. */
#ifndef _GL_WARN_ON_USE_CXX
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# if !defined __cplusplus
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+ _GL_WARN_ON_USE (function, msg)
+# else
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes
-# else /* Unsupported. */
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
# endif
#endif