Re: What gives smaller code size ?
From: Hans-Bernhard Broeker (broeker_at_physik.rwth-aachen.de)
Date: 04/29/04
- Next message: CodeSprite: "Re: What gives smaller code size ?"
- Previous message: Spehro Pefhany: "Re: uC favorites?"
- In reply to: Nadleira: "What gives smaller code size ?"
- Next in thread: CodeSprite: "Re: What gives smaller code size ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: CodeSprite: "Re: What gives smaller code size ?"
- Previous message: Spehro Pefhany: "Re: uC favorites?"
- In reply to: Nadleira: "What gives smaller code size ?"
- Next in thread: CodeSprite: "Re: What gives smaller code size ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|