Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/compat/sys



On Fri, Jun 15, 2018 at 18:05:29 +1000, matthew green wrote:

> "Robert Elz" writes:
> > Module Name:	src
> > Committed By:	kre
> > Date:		Fri Jun 15 07:46:59 UTC 2018
> > 
> > Modified Files:
> > 	src/sys/compat/sys: time_types.h
> > 
> > Log Message:
> > If we are going to use offsetof() we'd need to include <stddef.h> to
> > get it defined.  Rather than deal with potential namespace issues
> > with that, just clear the entire struct, rather than attempting to
> > stop after the potential padding field.   If the compiler is good enough
> > it should make no difference (there are just 3 fields, 2 named ones
> > are assigned to, immediately after the memset() - the compiler can
> > detect that, and not bother assigning (via memset()) to the unmamed
> > 3rd padding field).   If the compiler is not smart enough to deal
> > with this, then I doubt writing 8 more zero bytes will make enough
> > difference to matter.
> 
> the compiler isn't smart apparently, and the previous change
> should have fixed the problem.  did we really need this too?

Oh, thanks for fixing it, my bad.  Re memset - I now wonder if
compiler is even allowed to be smart here b/c strict aliasing (but I'm
not re^n-reading that part of the standard just to satisfy my idle
curiosity :)

-uwe


Home | Main Index | Thread Index | Old Index