1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 <2005> 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 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: | Strict aliasing |
From: | Al-Adwan Ahed <[email protected]> |
To: | [email protected] |
Date: | Fri, 18 Feb 2005 17:52:57 +0100 |
Compiling a Software driver - using gcc 3.4.2 and epics 3.14.6 - gives the following error:
../dev1394.c:178: warning: dereferencing type-punned pointer will break strict-aliasing rules ../dev1394.c:179: warning: dereferencing type-punned pointer will break strict-aliasing rules ../dev1394.c:180: warning: dereferencing type-punned pointer will break strict-aliasing rules ../dev1394.c:181: warning: dereferencing type-punned pointer will break strict-aliasing rules ../dev1394.c:182: warning: dereferencing type-punned pointer will break strict-aliasing rules ../dev1394.c:183: warning: dereferencing type-punned pointer will break strict-aliasing rules
Which is related to these lines in my code:
################## epicsExportAddress(dset,devAi1394); epicsExportAddress(dset,devAo1394); epicsExportAddress(dset,devStringin1394); epicsExportAddress(dset,devWaveform1394); epicsExportAddress(dset,devMbbi1394); epicsExportAddress(dset,devMbbo1394); ##################
Expanding the above macros shows no problem:
################## extern dset *pvar_dset_devAi1394; dset *pvar_dset_devAi1394 = (dset *)&devAi1394; extern dset *pvar_dset_devAo1394; dset *pvar_dset_devAo1394 = (dset *)&devAo1394; extern dset *pvar_dset_devStringin1394; dset *pvar_dset_devStringin1394 = (dset *)&devStringin1394; extern dset *pvar_dset_devWaveform1394; dset *pvar_dset_devWaveform1394 = (dset *)&devWaveform1394; extern dset *pvar_dset_devMbbi1394; dset *pvar_dset_devMbbi1394 = (dset *)&devMbbi1394; extern dset *pvar_dset_devMbbo1394; dset *pvar_dset_devMbbo1394 = (dset *)&devMbbo1394; ##################
When I compile using CFLAG= -fno-strict-aliasing, these warnings go away.
Any clues?
Cheers, Ahed
########################################### # Ahed Aladwan # # SLS Controls / Paul Scherrer Institute # # WSLA/208, 5232 Villigen PSI Switzerland # # Tel:+41 56 310 4594 # # Fax:+41 56 310 4413 # # www.psi.ch # # http://people.web.psi.ch/adwan/ # ################################################# ì |