EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Strict aliasing blog-post
From: Michael Davidsaver <[email protected]>
To: [email protected]
Date: Wed, 16 Mar 2016 10:36:26 -0400
On 03/16/2016 09:57 AM, Michael Davidsaver wrote:
int foo(dbCommon *prec) {
>    longinRecord *prec2 = (longinRecord*)prec;
>    prec->scan = 0;
>    prec2->scan = 1;
>    return *prec->scan;
> }
and it's complement, which are frequent.  While I suppose an optimizer
might not be smart enough to recognize that prec and prec2 are aliases,
imo if this were happening the breakage would be widespread.

As I think about it, "struct sockaddr" and friends are equivalent.  So while this may be a violation, Base is far from alone.


References:
Strict aliasing blog-post Andrew Johnson
Re: Strict aliasing blog-post Torsten Bögershausen
Re: Strict aliasing blog-post Michael Davidsaver

Navigate by Date:
Prev: Re: Strict aliasing blog-post Michael Davidsaver
Next: CA Gateway moved to GitHub Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Strict aliasing blog-post Michael Davidsaver
Next: Re: Strict aliasing blog-post Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 19 Mar 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·