[gcc r11-1060] [arm] (header usage fix) include c++ algorithm header via system.h

Christophe Lyon clyon@gcc.gnu.org
Mon Jun 8 08:16:33 GMT 2020


https://gcc.gnu.org/g:e7b3f654f2ab0400c95c0517387a9ad645a5c4cd

commit r11-1060-ge7b3f654f2ab0400c95c0517387a9ad645a5c4cd
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Jun 8 08:04:19 2020 +0000

    [arm] (header usage fix) include c++ algorithm header via system.h
    
    After the recent commit that forces uses of c++11, the arm part failed
    to build because it does not include <algorithm> via system.h as
    should be done.
    
    This results in:
    from /gcc/common/config/arm/arm-common.c:34:
    /usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h:42:12: error:
    attempt to use poisoned "malloc"
         return malloc (size);
    
    This patch fixes the problem by defining INCLUDE_ALGORITHM before
    including system.h and no longer includes <algorithm> directly.
    
    gcc/ChangeLog:
    
            * common/config/arm/arm-common.c (INCLUDE_ALGORITHM):
            Define. No longer include <algorithm>.

Diff:
---
 gcc/common/config/arm/arm-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c
index 78a779c9350..8e986e4b56b 100644
--- a/gcc/common/config/arm/arm-common.c
+++ b/gcc/common/config/arm/arm-common.c
@@ -19,6 +19,7 @@
 
 #define INCLUDE_LIST
 #define INCLUDE_VECTOR
+#define INCLUDE_ALGORITHM
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
@@ -31,7 +32,6 @@
 #include "flags.h"
 #include "sbitmap.h"
 #include "diagnostic.h"
-#include <algorithm>
 
 /* Set default optimization options.  */
 static const struct default_options arm_option_optimization_table[] =


More information about the Gcc-cvs mailing list