[PATCH v2 3/6] cpukit/libcsupport/src/__gettod.c: avoid warning

Matthew Joyce matthew.joyce at embedded-brains.de
Fri Jun 10 13:34:56 UTC 2022


From: Matt Joyce <matthew.joyce at embedded-brains.de>

Define _LIBC to ensure access to the function prototype.
The purpose is to avoid a new warning in gcc 12.

Updates #4662.
---
 cpukit/libcsupport/src/__gettod.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index 610f2c4d4a..e2a7ba6e64 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -39,9 +39,11 @@
 
 #if defined(RTEMS_NEWLIB)
 /*
- *  Needed to get the prototype for the newlib helper method
+ *  Needed to get the prototype for the newlib helper method. Which define
+ *  is required depends on the version of newlib.
  */
 #define _COMPILING_NEWLIB
+#define _LIBC
 
 #include <sys/time.h>
 #include <reent.h>
-- 
2.31.1



More information about the devel mailing list