[PATCH 01/16] rtems: Remove _RTEMS_version

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 13 06:51:47 UTC 2020


Move declaration and rename constant in _Version_String.

Close #3978.
---
 bsps/shared/rtems-version.c         | 2 +-
 cpukit/include/rtems/score/copyrt.h | 5 +++++
 cpukit/include/rtems/system.h       | 6 ------
 cpukit/sapi/src/getversionstring.c  | 5 ++---
 testsuites/sptests/spsize/size.c    | 2 +-
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/bsps/shared/rtems-version.c b/bsps/shared/rtems-version.c
index 99b98966e6..26f7a5731a 100644
--- a/bsps/shared/rtems-version.c
+++ b/bsps/shared/rtems-version.c
@@ -25,7 +25,7 @@
 #error "Missing RTEMS_BSP"
 #endif
 
-const char _RTEMS_version[] =
+const char _Version_String[] =
   "rtems-" RTEMS_VERSION " (" CPU_NAME "/" CPU_MODEL_NAME "/"
   RTEMS_XSTRING( RTEMS_BSP ) ")";
 
diff --git a/cpukit/include/rtems/score/copyrt.h b/cpukit/include/rtems/score/copyrt.h
index c7b00b4247..7addf4dbda 100644
--- a/cpukit/include/rtems/score/copyrt.h
+++ b/cpukit/include/rtems/score/copyrt.h
@@ -41,6 +41,11 @@ extern "C" {
  */
 extern const char _Copyright_Notice[];
 
+/**
+ * @brief The RTEMS version string.
+ */
+extern const char _Version_String[];
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/include/rtems/system.h b/cpukit/include/rtems/system.h
index 032ac56a95..3a2dff9721 100644
--- a/cpukit/include/rtems/system.h
+++ b/cpukit/include/rtems/system.h
@@ -39,12 +39,6 @@ extern "C" {
 
 #ifndef ASM
 
-/*
- * The use of this variable is deprecated, use rtems_get_version_string()
- * instead.
- */
-extern RTEMS_DEPRECATED const char _RTEMS_version[];
-
 /**
  *  The following is the extern for the RTEMS copyright string.
  */
diff --git a/cpukit/sapi/src/getversionstring.c b/cpukit/sapi/src/getversionstring.c
index f3fada9c48..4f29db0350 100644
--- a/cpukit/sapi/src/getversionstring.c
+++ b/cpukit/sapi/src/getversionstring.c
@@ -19,11 +19,10 @@
 #include "config.h"
 #endif
 
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
 #include <rtems.h>
+#include <rtems/score/copyrt.h>
 
 const char *rtems_get_version_string(void)
 {
-  return _RTEMS_version;
+  return _Version_String;
 }
diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
index d26e34f51d..ca6c3fc538 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -432,7 +432,7 @@ uninitialized += (sizeof _CPU_Interrupt_stack_low) +
 
 initialized +=
 /*copyrt.h*/    (strlen(_Copyright_Notice)+1)             +
-                (strlen(_RTEMS_version)+1);
+                (strlen(_Version_String)+1);
 
 
 
-- 
2.26.2



More information about the devel mailing list