Re: NULL pointer arithmetic issues

2020-03-09 Thread Aaron Ballman
On Mon, Mar 9, 2020 at 2:53 PM Martin Husemann wrote: > > On Mon, Mar 09, 2020 at 12:41:37PM -0400, Aaron Ballman wrote: > > > You could view NULL as a special pointer pointing to an inaccessible > > > zero sized object. Adding 0 to it still points to the same special &

Re: NULL pointer arithmetic issues

2020-03-09 Thread Aaron Ballman
On Mon, Mar 9, 2020 at 12:36 PM Joerg Sonnenberger wrote: > > On Mon, Mar 09, 2020 at 09:50:50AM -0400, Aaron Ballman wrote: > > On Sun, Mar 8, 2020 at 2:30 PM Taylor R Campbell > > > I ask because in principle a conformant implementation could compile > > > the Net

Re: NULL pointer arithmetic issues

2020-03-09 Thread Aaron Ballman
On Mon, Mar 9, 2020 at 11:51 AM Martin Husemann wrote: > > On Mon, Mar 09, 2020 at 09:38:31AM -0400, Aaron Ballman wrote: > > The way I read this is: > > > > "If the pointer operand points to an element of an array object" -- it > > does not (null is

Re: NULL pointer arithmetic issues

2020-03-09 Thread Aaron Ballman
ant for performance purposes. It's also not important > for expressive purposes, because I could just as well have written > assert(a != NULL). > > > > I was told by Roman that it was checked during a C committee meeting and > > > confirmed to be an intentional UB. > >

Re: NULL pointer arithmetic issues

2020-03-09 Thread Aaron Ballman
On Mon, Mar 9, 2020 at 9:21 AM Martin Husemann wrote: > > On Mon, Mar 09, 2020 at 01:34:23PM +0100, Kamil Rytarowski wrote: > > > We instruct a C compiler that pointer used in the pserialize macros is > > never NULL, as the side effect of adding to it 0. > > I question that side effect. > > The