This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: memcpy / Language Lawyer / optimization question
- From: Geoffrey Keating <geoffk at geoffk dot org>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 09 Dec 2004 15:36:39 -0800
- Subject: Re: memcpy / Language Lawyer / optimization question
- References: <BDDE41C0.82F2%schlie@comcast.net>
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.