2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 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) { *prec2 = (longinRecord*)prec; prec->scan = 0; prec2->scan = 1; return *prec->scan; }longinRecordand 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. |