This is the mail archive of the gcc-patches@gcc.gnu.org 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]

RE: [PATCH] Portable Volatility Warning


On Wed, 4 Sep 2013 19:48:13, Hans-Peter Nilsson wrote:
> On Tue, 3 Sep 2013, Richard Biener wrote:
>> I think the warning can be completely implemented inside struct-layout.c
>> for example in finish_bitfield_representative (if you pass that the first field
>> in the group, too). Of course that is at the expense of warning for
>> struct declarations rather than actual code differences (the struct may
>> not be used)
>
> FWIW, I don't feeling stringly whether this is ok or not, but I
> *think* missing warnings for (unused) declarations is ok; we are
> (ok, I am) interested in semantic differences for generated
> code, not declarations.
>
> brgds, H-P

Well, the way I see this is as follows:

If the generated code depends on whether -fstrict-volatile-bitfileds setting,
a warning should be generated.

Of course there should be no false-positives. Otherwise this feature would be useless.

The generated code depends on:
- If the member is a bit field. (and not only a unaligned data value)
- If the member is declared volatile.
- If the object is declared volatile.
- If the pointer is declared volatile.
- The alignment of the structure.
- The alignment of the access.

That's why I chose that approach, otherwise I would only warn on every bit field,
and that would be silly.

Richard, I hope this discussion is not holding up Sandra's patch.
At least Parts 1-3 are completely non-controversial.

Thanks
Bernd. 		 	   		  

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