Experimental Physics and Industrial Control System
|
|
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
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
- 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
<2016>
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
|
|
ANJ, 19 Mar 2016 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
·
Distributions
·
Download
·
Documents
·
Links
·
Licensing
·
|