This is the mail archive of the gcc@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: GCC aliasing rules: more aggressive than C99?


This discussion prompts me to relate something from
experience in exegesis of the Ada RM.

In Robert's rules of order, there is an overriding
rule that says "none of the other rules in this book
can be used to obfuscate" [don't have my copy here,
so not an exact quote].

Following that line of thinking,
I proposed for the Ada standard that we consider
(but perhaps not include explicitly) that the standard
has an overarching rule

"none of the other rules in this standard can be used
to derive obviously incorrect conclusions".

The work of interpreting a standard is always one of
interpreting intention. Most of the time, we expect
that the language clearly indicates that intention,
but when it doesn't, we don't blindly follow some
misprint or thinko in the standard, we figure out
what was intended and makes sense.

Of course we still may need to do careful exegesis
to see if the standard needs fixing or clarification.

My own thoughts in this case, not being a real
expert in the C standard, is that the standard
seems pretty clear and supports the gcc interpretation.

In any case the gcc interpretation is clearly what's
intended in my view, so if it can be argued that the
standard is inconsistent with this interpretation (I
am unconvinced that this burden has been met), then
the conclusion is to add a clarification to the
standard, not to modify the gcc behavior.

Yes, this behavior may surprise, but there are a
number of practices in C that are clearly outside
the language. Even with the original K&R definition,
there were lots of things clearly specified to lead
to undefined behavior that people got used to using
because they happen to work.

Any time you let the actual behavior of a particular
be your language tutor, you are in trouble. There is
no substitute for knowing the language accurately.


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