Re: What gives smaller code size ?

From: Hans-Bernhard Broeker (broeker_at_physik.rwth-aachen.de)
Date: 04/29/04


Date: 29 Apr 2004 14:43:23 GMT

Nadleira <dan_elbert@yahoo.com> wrote:

> What will give smaller code size, when we have something like
> char buf[32] appearing in many functions ?

Wrong question. The given alternatives differ in semantics, rendering
whatever differences there may be in code size quite irrelevant.

The main effect they'll have is on data size, anyway, because they differ
in how many independent buffers you'll end up with.

> 1. Declare it in each function ("auto")
> 2. Declare it as global.
> 3. Declare it as global and static.

Oh, and you missed one:

  4. Declare it static in each function.

-- 
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.


Relevant Pages

  • Re: which quotation marks to use
    ... which does no harm because the code points where they differ are not ... used for anything meaningful in either ISO 8859-1 or Unicode. ... it is advisable to declare ... non-propriertary codes which then appear in the declarations of HTML ...
    (comp.infosystems.www.authoring.html)
  • Re: The case insensitive #include statement horror...
    ... It preserves the data, because it preserves the case of the filenames ... they contain some semantics in the spelling. ... given a string of eight characters there are 256 possible files which can ... we won't allow two different files with names that differ only in case ...
    (microsoft.public.vc.language)
  • Re: How do you bitwise operations in Ada 83 and 95
    ... Performance may differ, ... I can observe how ... we all realize that the semantics, as defined by the RM, does not ... behavior is a meaningful comparison. ...
    (comp.lang.ada)