diff options
Diffstat (limited to 'gl/warn-on-use.h')
| -rw-r--r-- | gl/warn-on-use.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gl/warn-on-use.h b/gl/warn-on-use.h index 701013a0..c0072412 100644 --- a/gl/warn-on-use.h +++ b/gl/warn-on-use.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* A C macro for emitting warnings if a function is used. | 1 | /* A C macro for emitting warnings if a function is used. |
| 2 | Copyright (C) 2010-2024 Free Software Foundation, Inc. | 2 | Copyright (C) 2010-2025 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This program is free software: you can redistribute it and/or modify it | 4 | This program is free software: you can redistribute it and/or modify it |
| 5 | under the terms of the GNU Lesser General Public License as published | 5 | under the terms of the GNU Lesser General Public License as published |
| @@ -85,7 +85,7 @@ | |||
| 85 | */ | 85 | */ |
| 86 | #ifndef _GL_WARN_ON_USE | 86 | #ifndef _GL_WARN_ON_USE |
| 87 | 87 | ||
| 88 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) | 88 | # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ |
| 89 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ | 89 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ |
| 90 | # define _GL_WARN_ON_USE(function, message) \ | 90 | # define _GL_WARN_ON_USE(function, message) \ |
| 91 | _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) | 91 | _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) |
| @@ -98,7 +98,7 @@ _GL_WARN_EXTERN_C __typeof__ (function) function \ | |||
| 98 | __attribute__ ((__diagnose_if__ (1, message, "warning"))) | 98 | __attribute__ ((__diagnose_if__ (1, message, "warning"))) |
| 99 | # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ | 99 | # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ |
| 100 | __attribute__ ((__diagnose_if__ (1, message, "warning"))) | 100 | __attribute__ ((__diagnose_if__ (1, message, "warning"))) |
| 101 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING | 101 | # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING |
| 102 | /* Verify the existence of the function. */ | 102 | /* Verify the existence of the function. */ |
| 103 | # define _GL_WARN_ON_USE(function, message) \ | 103 | # define _GL_WARN_ON_USE(function, message) \ |
| 104 | _GL_WARN_EXTERN_C __typeof__ (function) function | 104 | _GL_WARN_EXTERN_C __typeof__ (function) function |
| @@ -121,7 +121,7 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use | |||
| 121 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ | 121 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ |
| 122 | _GL_WARN_ON_USE (function, msg) | 122 | _GL_WARN_ON_USE (function, msg) |
| 123 | # else | 123 | # else |
| 124 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) | 124 | # if (4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)) && !defined __clang__ |
| 125 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ | 125 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ |
| 126 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ | 126 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ |
| 127 | extern rettype_gcc function parameters_and_attributes \ | 127 | extern rettype_gcc function parameters_and_attributes \ |
| @@ -131,7 +131,7 @@ extern rettype_gcc function parameters_and_attributes \ | |||
| 131 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ | 131 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ |
| 132 | extern rettype_clang function parameters_and_attributes \ | 132 | extern rettype_clang function parameters_and_attributes \ |
| 133 | __attribute__ ((__diagnose_if__ (1, msg, "warning"))) | 133 | __attribute__ ((__diagnose_if__ (1, msg, "warning"))) |
| 134 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING | 134 | # elif (__GNUC__ >= 3 || defined __clang__) && GNULIB_STRICT_CHECKING |
| 135 | /* Verify the existence of the function. */ | 135 | /* Verify the existence of the function. */ |
| 136 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ | 136 | # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ |
| 137 | extern rettype_gcc function parameters_and_attributes | 137 | extern rettype_gcc function parameters_and_attributes |
