lkml.org 
[lkml]   [2019]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings
Date
From: Moore, Robert
> Sent: 26 July 2019 20:36
...
> This is because pointer arithmetic
> on a pointer not pointing to an array is an undefined behavior (C11 6.5.6, constraint 8).
...

The standards committee as smoking dope again :-)
If that is enforced as a compiler warning/error a lot of code 'breaks'.
Anything that does:
struct foo *foo = ...;
struct bar *bar = (void *)(foo + 1);
suddenly becomes 'invalid'.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2019-07-29 12:25    [W:0.653 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site