Been moving over an existing project to M2M Studio with OpenAt 2.20.
I’m getting a compiler warning that I haven’t seen before:
dereferencing type-punned pointer will break strict-aliasing rules
This warning is appearing for every instance of
adl_memRelease( pointer );
I have in my project.
A bit of searching around on the web has indicated that this is a common warning to have pop up when moving code to GCC 4 from earlier GGC versions, and it can be disabled by using the
- Can anyone explain what this warning means with regards to the OpenAT environment?
- In M2M Studio, how can I add the -fno-strict-aliasing option to the compiler command line?
- Is there any way to cast the pointer variable in my code so that the -fno-strict-aliasing option is not required?
I know that it’s just a warning and can be ignored. However, there are so many of them in the log (I’m doing a lot of memory get/release operations) that other warnings are getting lost in the noise.