memcpy / Language Lawyer / optimization question

Geoffrey Keating geoffk@geoffk.org
Thu Dec 9 23:36:00 GMT 2004


Paul Schlie <schlie@comcast.net> writes:

> As a more general but related question: as C does not define/specify
> everything, and even occasionally specifies something as being explicitly
> "unspecified", giving license to the complier to express whatever incidental
> behavior it may have; has the GCC team adopted the strategy that it will
> strive to adopt and document the behavior which seems most generally useful
> and/or least-fragile in such circumstances (which it has license to do), as
> opposed to justifying any such behavior as being "legal" without regard to
> the consideration of adopting a more useful behavior, and/or emit warnings
> if the adopted behavior may have undesirable consequences when reasonable
> to do so; or is this also "unspecified"? :)

No, that strategy has not been adopted.  This avoids arguments about
what is "most generally useful" or "least-fragile".  What people
usually mean by such statements is "whatever compiler X does" or
"whatever the previous version of GCC does" or "this particular
behaviour that my program expects", and generally you can find
evidence in that form for many possible behaviours.



More information about the Gcc mailing list