[patch,rtems] Don't build __assert_func for RTEMS

View: New views
3 Messages — Rating Filter:   Alert me  

[patch,rtems] Don't build __assert_func for RTEMS

by Ralf Corsepius-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

another RTEMS patch.

RTEMS has a version of __assert_func of its own outside of newlib and
therefore doesn't need newlib's __assert_func.

Ralf



[newlib-rtems-assert.diff]

2009-09-22 Ralf Corsépius <ralf.corsepius@...>

        * libc/stdlib/assert.c (__assert_func): Don't build for RTEMS.

Index: libc/stdlib/assert.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/assert.c,v
retrieving revision 1.3
diff -u -r1.3 assert.c
--- libc/stdlib/assert.c 27 Jun 2007 12:44:41 -0000 1.3
+++ libc/stdlib/assert.c 22 Sep 2009 03:32:37 -0000
@@ -47,6 +47,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#if !defined(__rtems__)
+/* RTEMS has a version of its own */
+
 /* func can be NULL, in which case no function information is given.  */
 void
 _DEFUN (__assert_func, (file, line, func, failedexpr),
@@ -62,6 +65,7 @@
   abort();
   /* NOTREACHED */
 }
+#endif
 
 void
 _DEFUN (__assert, (file, line, failedexpr),


Re: [patch,rtems] Don't build __assert_func for RTEMS

by Jeff Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 21/09/09 11:36 PM, Ralf Corsepius wrote:

> Hi,
>
> another RTEMS patch.
>
> RTEMS has a version of __assert_func of its own outside of newlib and
> therefore doesn't need newlib's __assert_func.
>
> Ralf
>
>

I would like to modify this to use a generic flag rather than a check
for __rtems.  I really want to change all the various OS and platform
checks we have in shared headers/code and replace them with more
generic-usage ones (Cygwin and rtems are the most prevalent).

In this case, I would like to suggest either HAVE___ASSERT_FUNC or
_EXTERNAL_ASSERT_FUNC (or feel free to come up with a better one).

I can make the change myself and add the flag to the rtems set in
configure.host if you are ok with any particular flag choice.

-- Jeff J.

Re: [patch,rtems] Don't build __assert_func for RTEMS

by Jeff Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 22/09/09 05:45 PM, Jeff Johnston wrote:

> On 21/09/09 11:36 PM, Ralf Corsepius wrote:
>> Hi,
>>
>> another RTEMS patch.
>>
>> RTEMS has a version of __assert_func of its own outside of newlib and
>> therefore doesn't need newlib's __assert_func.
>>
>> Ralf
>>
>>
>
> I would like to modify this to use a generic flag rather than a check
> for __rtems. I really want to change all the various OS and platform
> checks we have in shared headers/code and replace them with more
> generic-usage ones (Cygwin and rtems are the most prevalent).
>
> In this case, I would like to suggest either HAVE___ASSERT_FUNC or
> _EXTERNAL_ASSERT_FUNC (or feel free to come up with a better one).
>
> I can make the change myself and add the flag to the rtems set in
> configure.host if you are ok with any particular flag choice.
>
> -- Jeff J.

I went with HAVE_ASSERT_FUNC.  Patch using this flag has been checked in.

-- Jeff J.