Re: [PATCH 1/3] include: Define FIELD_OFFSET to the standard offsetof macro

2012-12-11 Thread Michael Stefaniuc
On 12/11/2012 10:20 AM, Dmitry Timoshkov wrote: > Michael Stefaniuc wrote: > >> On 12/10/2012 07:37 PM, Amine Khaldi wrote: >>> This prevents the undefined behavior (null pointer dereference) >>> diagnostics (clang with ubsan checks for example). >> This is a bug in clang. There is no null pointe

Re: [PATCH 1/3] include: Define FIELD_OFFSET to the standard offsetof macro

2012-12-11 Thread Dmitry Timoshkov
Michael Stefaniuc wrote: > On 12/10/2012 07:37 PM, Amine Khaldi wrote: > > This prevents the undefined behavior (null pointer dereference) > > diagnostics (clang with ubsan checks for example). > This is a bug in clang. There is no null pointer dereference. > Afair gcc tried to pull this trick to

Re: [PATCH 1/3] include: Define FIELD_OFFSET to the standard offsetof macro

2012-12-10 Thread Michael Stefaniuc
On 12/10/2012 07:37 PM, Amine Khaldi wrote: > This prevents the undefined behavior (null pointer dereference) > diagnostics (clang with ubsan checks for example). This is a bug in clang. There is no null pointer dereference. Afair gcc tried to pull this trick too but got educated about their error.