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 for various warnings in gcc


On Thu, Aug 08, 2002 at 01:51:45PM -0400, Paul Koning wrote:

>  Zack> The cost of
>  Zack> doing a single load-constant-zero instruction is unlikely to be
>  Zack> measurable, and using a deterministic initializer is simply
>  Zack> good defensive programming.  We have unconditional 'if
>  Zack> (impossible) abort()' checks all over the compiler - those are
>  Zack> more expensive, surely, and no one suggests removing them.
> 
> Whether the cost of "set to zero" is trivial depends on the
> application.  If the application is a compiler, I certainly agree.  If
> the code is a high speed data path for an embedded device, I strongly
> disagree. 
> 
> So if you want to have a coding rule that says "a=a initialization is
> not allowed in coding within gcc" I have no objection.  If you want to
> eliminate the ability to suppress spurious warnings in other code,
> that's a different matter entirely.

Yes, I was only talking about the preferred coding style within GCC
itself.  Naturally the tradeoffs may be different in a different
application.

zw


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