This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Do not expand macros to 'defined'


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7516c26f867b8c235f28a4d449efb9990125e0a1

commit 7516c26f867b8c235f28a4d449efb9990125e0a1
Author: Pavel I. Kryukov <kryukov@frtk.ru>
Date:   Wed Jan 16 16:04:34 2019 -0500

    Do not expand macros to 'defined'
    
    Expanding a macro which contains 'defined' PP keyword is UB.  It causes
    a compilation failure when -Wexpansion-to-defined is used.
    
    sim/common/Changelog:
    2019-01-16  Pavel I. Kryukov  <kryukov@frtk.ru>
    
    	* sim-arange.c: eliminate DEFINE_NON_INLINE_P

Diff:
---
 sim/common/ChangeLog    | 4 ++++
 sim/common/sim-arange.c | 8 +++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index a95735a..1fddb4e 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-16  Pavel I. Kryukov  <kryukov@frtk.ru>
+
+	* sim-arange.c: eliminate DEFINE_NON_INLINE_P
+
 2019-01-15  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* sim-arange.h (SIM_ARANGE_INLINE): Change EXTERN to extern.
diff --git a/sim/common/sim-arange.c b/sim/common/sim-arange.c
index 6373b74..0f0c8a1 100644
--- a/sim/common/sim-arange.c
+++ b/sim/common/sim-arange.c
@@ -35,7 +35,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define DEFINE_INLINE_P (! defined (SIM_ARANGE_C_INCLUDED))
 #define DEFINE_NON_INLINE_P defined (SIM_ARANGE_C_INCLUDED)
 
-#if DEFINE_NON_INLINE_P
+#ifdef SIM_ARANGE_C_INCLUDED
 
 /* Insert a range.  */
 
@@ -280,9 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, address_word start, address_word end)
   build_search_tree (ar);
 }
 
-#endif /* DEFINE_NON_INLINE_P */
-
-#if DEFINE_INLINE_P
+#else /* SIM_ARANGE_C_INCLUDED */
 
 SIM_ARANGE_INLINE int
 sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr)
@@ -301,4 +299,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr)
   return 0;
 }
 
-#endif /* DEFINE_INLINE_P */
+#endif /* SIM_ARANGE_C_INCLUDED */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]