Policy for return by reference values in error cases

2021-03-23 Thread Sebastian Huber
Hello, for the RTEMS pre-qualification project I review currently most parts of the Classic API. It seems we have an unwritten rule that directives should not write to variables referenced by directive parameters if an error occurs. Examples: * rtems_task_mode(previous_mode) * rtems_task_se

Re: Policy for return by reference values in error cases

2021-03-23 Thread Joel Sherrill
On Tue, Mar 23, 2021, 12:30 PM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Hello, > > for the RTEMS pre-qualification project I review currently most parts of > the Classic API. It seems we have an unwritten rule that directives > should not write to variables referenced by dire

Re: Policy for return by reference values in error cases

2021-03-23 Thread Sebastian Huber
On 23/03/2021 18:48, Joel Sherrill wrote: My first thought is that I don't like covering up for applications that do the wrong thing. This topic just came up recently in a discussion about defensive programming. We also test for NULL pointers. I'm overall rather ambiguous. It is possible that

Re: Policy for return by reference values in error cases

2021-03-23 Thread Joel Sherrill
On Tue, Mar 23, 2021 at 12:58 PM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 23/03/2021 18:48, Joel Sherrill wrote: > > > My first thought is that I don't like covering up for applications > > that do the wrong thing. > This topic just came up recently in a discussion about d

Re: Policy for return by reference values in error cases

2021-03-23 Thread Gedare Bloom
On Tue, Mar 23, 2021 at 12:37 PM Joel Sherrill wrote: > > > > On Tue, Mar 23, 2021 at 12:58 PM Sebastian Huber > wrote: >> >> On 23/03/2021 18:48, Joel Sherrill wrote: >> >> > My first thought is that I don't like covering up for applications >> > that do the wrong thing. +.5 >> This topic just

Re: Policy for return by reference values in error cases

2021-03-23 Thread Gedare Bloom
On Tue, Mar 23, 2021 at 1:21 PM Gedare Bloom wrote: > > On Tue, Mar 23, 2021 at 12:37 PM Joel Sherrill wrote: > > > > > > > > On Tue, Mar 23, 2021 at 12:58 PM Sebastian Huber > > wrote: > >> > >> On 23/03/2021 18:48, Joel Sherrill wrote: > >> > >> > My first thought is that I don't like coverin

Re: Policy for return by reference values in error cases

2021-03-25 Thread Sebastian Huber
On 23/03/2021 20:21, Gedare Bloom wrote: On Tue, Mar 23, 2021 at 12:58 PM Sebastian Huber wrote: On 23/03/2021 18:48, Joel Sherrill wrote: My first thought is that I don't like covering up for applications that do the wrong thing. +.5 This topic just came up recently in a discussion abou

Re: Policy for return by reference values in error cases

2021-03-25 Thread Joel Sherrill
On Thu, Mar 25, 2021, 1:16 PM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 23/03/2021 20:21, Gedare Bloom wrote: > > >> On Tue, Mar 23, 2021 at 12:58 PM Sebastian Huber< > sebastian.hu...@embedded-brains.de> wrote: > >>> On 23/03/2021 18:48, Joel Sherrill wrote: > >>> >