From 06342d86deb5166b4aaa0fa633959d03cfd29aa5 Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Mon, 15 Jun 2020 15:29:25 +0200
Subject: [PATCH] Changed C++ compiler version errors to warnings if the
 compiler version is 5 or newer (bug 564194)

Change-Id: Id6045fb10f6caae8fc5415fa8048a9c3bbe523df
Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
---
 core/gccversion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/gccversion.c b/core/gccversion.c
index 6ab738386..bf5883f55 100644
--- a/core/gccversion.c
+++ b/core/gccversion.c
@@ -71,11 +71,11 @@ int main(void)
 #else
     "#if GCC_VERSION != %d\n"
 #endif
-    "#error The version of " COMPILER_NAME_STRING " does not match the expected version (" COMPILER_NAME_STRING " %d.%d.%d)\n"
+    "#%s The version of " COMPILER_NAME_STRING " does not match the expected version (" COMPILER_NAME_STRING " %d.%d.%d)\n"
     "#endif\n", compiler_major * 10000 + compiler_minor * 100,
     /* Note that we don't use compiler_patchlevel when checking.
      * This assumes that code is portable between GCC a.b.x and a.b.y */
-    compiler_major, compiler_minor, compiler_patchlevel);
+    compiler_major < 5 ? "error" : "warning", compiler_major, compiler_minor, compiler_patchlevel);
 #elif defined(__SUNPRO_C)
   printf("\n"
     "#if __SUNPRO_CC != 0x%X\n"
-- 
GitLab