🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2190

Re: "extern" and function declarations

#2190
From: Stan Ryckman
Date: Thu, 07 Mar 1996 00:29
41 lines
2118 bytes
In article <4hdqjq$8pr@solutions.solon.com>,
Lawrence Kirby <fred@genesis.demon.co.uk> wrote:

[lots of good information snipped]

> > If your 
> > functions are called from within one module only, declaring them 'static' 
> > reduces the amount of object code produced.
>
>It might reduce the size of an external symbol table but that's about it.
>static avoid the possibility of name conflicts between different translation
>units (what you call modules).

Actually, it *may* reduce the object code produced.  It *may* increase
the size of it too (by inlining, for example).  One obvious reduction
is to generate no code for static functions which are never called
(and which never have pointers to them returned to anything external).
Less obvious is that it may be possible to generate "near calls"
rather than "far calls" in some implementations.

The better arguments for static functions deal with hiding information
from places where it doesn't need to be seen, of course.

[more snippage]

>I'm curious - do people find this enlightening (you learnt something),
>obvious (you knew it already, comp.std.c regulars need not apply),
>unintelligible (I didn't explain it very clearly) or uninteresting (not
>worth the bandwidth)?

While I didn't need it, it's always worth re-reading once in a while, I
think.  And maybe it will help improve the quality of future posts :-)
I'd saved that article to reply to, but you said it much better.

My only criticism would be that I'd really love it if you could get
your newsreader to do the references correctly for threading!  :-)

Cheers,
Stan.
--
Stan Ryckman  (stanr@tiac.net) (new e-mail address)
Technical Details
Message-ID: <4hlam1$4im@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4hdqjq$8pr@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: stanr@tiac.net (Stan Ryckman)
Newsgroups: comp.lang.c.moderated
Subject: Re: "extern" and function declarations
Date: 6 Mar 1996 18:29:53 -0600
Organization: Amber & Sneakers Fan Club
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4hlam1$4im@solutions.solon.com>
References: <4hdqjq$8pr@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com