From 000d134877479b91f2fe94afdb39f72a0d87cbf8 Mon Sep 17 00:00:00 2001
From: Alberto Nidasio <nidasioalberto@gmail.com>
Date: Fri, 16 Aug 2024 16:50:43 +0200
Subject: [PATCH] Updated newlib patch to add missing annotation in malloc.h

---
 .../gcc-9.2.0-mp3.2/patches/newlib.patch      | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/miosix/_tools/compiler/gcc-9.2.0-mp3.2/patches/newlib.patch b/miosix/_tools/compiler/gcc-9.2.0-mp3.2/patches/newlib.patch
index df50acb2..9da7f46d 100644
--- a/miosix/_tools/compiler/gcc-9.2.0-mp3.2/patches/newlib.patch
+++ b/miosix/_tools/compiler/gcc-9.2.0-mp3.2/patches/newlib.patch
@@ -7698,3 +7698,53 @@ diff -ruN newlib-3.1.0-old/newlib/libc/sys/miosix/termios.c newlib-3.1.0/newlib/
 +{
 +    return ioctl(fd,IOCTL_FLUSH,(void*)opt);
 +}
+diff -ruN newlib-3.1.0-old/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h newlib-3.1.0/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h
+--- newlib-3.1.0-old/newlib/libc/include/malloc.h 1970-01-01 01:00:00.000000000 +0100
++++ newlib-3.1.0/newlib/libc/include/malloc.h  2024-06-20 21:50:35.000000000 +0100
+@@ -34,36 +34,36 @@ struct mallinfo {
+
+ /* The routines.  */
+
+-extern void *malloc (size_t);
++extern void *malloc (size_t) _NOTHROW;
+ #ifdef __CYGWIN__
+ #undef _malloc_r
+ #define _malloc_r(r, s) malloc (s)
+ #else
+-extern void *_malloc_r (struct _reent *, size_t);
++extern void *_malloc_r (struct _reent *, size_t) _NOTHROW;
+ #endif
+
+-extern void free (void *);
++extern void free (void *) _NOTHROW;
+ #ifdef __CYGWIN__
+ #undef _free_r
+ #define _free_r(r, p) free (p)
+ #else
+-extern void _free_r (struct _reent *, void *);
++extern void _free_r (struct _reent *, void *) _NOTHROW;
+ #endif
+
+-extern void *realloc (void *, size_t);
++extern void *realloc (void *, size_t) _NOTHROW;
+ #ifdef __CYGWIN__
+ #undef _realloc_r
+ #define _realloc_r(r, p, s) realloc (p, s)
+ #else
+-extern void *_realloc_r (struct _reent *, void *, size_t);
++extern void *_realloc_r (struct _reent *, void *, size_t) _NOTHROW;
+ #endif
+
+-extern void *calloc (size_t, size_t);
++extern void *calloc (size_t, size_t) _NOTHROW;
+ #ifdef __CYGWIN__
+ #undef _calloc_r
+ #define _calloc_r(r, s1, s2) calloc (s1, s2);
+ #else
+-extern void *_calloc_r (struct _reent *, size_t, size_t);
++extern void *_calloc_r (struct _reent *, size_t, size_t) _NOTHROW;
+ #endif
+
+ extern void *memalign (size_t, size_t);
+--
+2.45.2
-- 
GitLab