On 29.11.2017 20:51, Michael Davidsaver wrote:
On 11/29/2017 12:43 PM, Dirk Zimoch wrote:
The file anyscalar.h generates many warnings of the form
/afs/psi.ch/group/8431/dirk/git/BASE/epics-base-master/include/pv/anyscalar.h:98:
warning: dereferencing pointer ‘<anonymous>’ does break
strict-aliasing rules
The construct used (std::aligned_storage) is well defined in c++11.
http://en.cppreference.com/w/cpp/types/aligned_storage
I am a bit concerned about that because it may lead to wrong
optimization. I think this should either be fixed or
-fno-strict-aliasing should be added to the compiler flags for recent
gccs (i.e. not old vxWorks :-) )
GCC >=4.8.4 (at latest) doesn't warn about this even with -std=c++98.
So if anything, this is only need for older compilers.
I checked the code and found that older compilers (those who complain)
see a different piece of code. (#if __cplusplus>=201103L ... #else). And
not all of them complain.
I will do some tests to find out if I can remove the warnings. If not, I
will add the -fno-strict-aliasing compiler option to my architectures
which use older compilers and to the vxWorks configuration in EPICS.
But this is no showstopper for the release.