Re: const and static (was: C vs. assembly...)

<sharris@fox.nstn.ca>
13 Apr 1996 23:06:35 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: const and static (was: C vs. assembly...) mason@ease.com (1996-03-29)
Re: const and static (was: C vs. assembly...) cdg@nullstone.com (1996-04-02)
Re: const and static (was: C vs. assembly...) jmccarty@sun1307.spd.dsccc.com (1996-04-02)
Re: const and static (was: C vs. assembly...) KingD@rnd1.indy.tce.com (King Dale) (1996-04-11)
Re: const and static (was: C vs. assembly...) cdg@nullstone.com (1996-04-12)
Re: const and static (was: C vs. assembly...) cdg@nullstone.com (1996-04-12)
Re: const and static (was: C vs. assembly...) sharris@fox.nstn.ca (1996-04-13)
Re: const and static (was: C vs. assembly...) mfinney@inmind.com (1996-04-16)
Re: const and static (was: C vs. assembly...) schwarz@mips.complang.tuwien.ac.at (1996-04-18)
| List of all articles for this month |
From: <sharris@fox.nstn.ca>
Newsgroups: comp.compilers
Date: 13 Apr 1996 23:06:35 -0400
Organization: Nova Scotia Technology Network
References: 96-03-106 96-03-202 96-04-021 96-04-081
Keywords: C, optimize, performance, comment

Christopher Glaeser <cdg@nullstone.com> wrote:


>. . . many C programmers use const as a replacement for
>#define, and . . . expect the code to be as efficient as #define.


Good grief.


>From Ken Thompson's description of his C compiler for Plan 9:


      The compiler implements ANSI C with some restrictions and
      extensions. . . Several of the poorer features were left out.
      . . .


      The keywords register, volatile and const are recognised
      syntactically, but are semantically ignored. Volatile seems
      to have no meaning, so it is hard to tell if ignoring it is
      a departure from the standard. Const only confuses library
      interfaces wuth hope of catching some rare errors.


      Register is a holdover from the past. . . .
[I have considerable sympathy for Ken's opinion re volatile and const
function arguments, for for static and extern data, which is what this
discussion has been about, it seems well enough defined. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.