NULL for return by reference values: error or ignore?

Joel Sherrill joel at rtems.org
Tue Mar 23 17:46:05 UTC 2021


On Tue, Mar 23, 2021, 12:36 PM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> Hello,
>
> we have a couple of directives which set something and return the
> previous value, for example rtems_task_mode() and
> rtems_task_set_priority(). The value is returned through a pointer
> parameter. If this pointer is NULL, then the directives do nothing and
> just returns an error status. Why don't we simply not return a value in
> this case, so that you can set the task priority via
> rtems_task_set_priority(id, priority, NULL)?
>

I'm okay with this. It seems more in keeping with the POSIX behavior.

--joel

>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210323/78813262/attachment.html>


More information about the devel mailing list