This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Portable Volatility Warning

This is a follow-up patch for Sandra Loosemore's patch in this
thread: "reimplement -fstrict-volatile-bitfields, v3".

It was already posted a few weeks ago, but in the wrong thread.
Therefore I re-post it herewith.

It was initially suggested by Hans-Peter Nilsson, and I had much
help from him in putting everything together. Thanks again H-P.

Here is a short specification:

The -Wportable-volatility warning is an optional warning, to warn
about code for which separate incompatbile definitions on different
platforms (or between C and C++) exist even within gcc.
It will be usable for driver code you want to be portable on different

This warning should only be emitted if the code is significantly
different when -fstrict-volatile-bitfields is used or not.

It should not be emitted for the code which is not affected by this

In other words, it should be emitted on all bit-fields when the
definition or the context is volatile, except when the whole
structure is not AAPCS ABI compliant, i.e. packed or unaligned.

On the other hand you should always get the same
warnings if you combine -Wportable-volatility with
-fstrict-volatile-bitfields or not. And of course it should not
depend on the specific target that is used to compile.

I boot-strapped this on a i686-pc-linux-gnu and all Wportable-volatility
test cases are passed for C and C++.

Additionally I used a cross-compiler for arm-eabi to manually cross-check
that the warnings are independent of the target platform.

Bernd Edlinger 		 	   		  

Attachment: changelog-portable-volatility.txt
Description: Text document

Attachment: patch-portable-volatility.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]