Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #69943

Re: who invented static?

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: who invented static?
Date Tue, 08 Sep 2015 10:18:18 -0700
Organization None to speak of
Lines 41
Message-ID <ln4mj4sucl.fsf@kst-u.example.com> (permalink)
References <661ee2d4-d23e-4602-a48b-86c669001de6@googlegroups.com> <4e9adb87-3258-4b90-92b5-f9e89674f504@googlegroups.com> <23d45408-26bc-46a3-8b48-2593b5c29ad4@googlegroups.com> <6036cc6f-2804-45c2-95f4-e19a5fa9399d@googlegroups.com> <55E21F50.2080705@verizon.net> <mrv5f3$g9b$1@dont-email.me> <55E32CBB.2050001@verizon.net> <mrvcnh$fju$1@dont-email.me> <kfnio7nng50.fsf@x-alumni2.alumni.caltech.edu> <msjhi9$2d9$1@dont-email.me> <lny4gisiz6.fsf@kst-u.example.com> <msjodd$qjn$1@dont-email.me> <55EDC3A8.3000804@verizon.net> <msko74$ueg$1@dont-email.me> <kfnsi6pn81d.fsf@x-alumni2.alumni.caltech.edu>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="31605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+p6o5MvdvOvIR9XD7twghc"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:219ThHqDtTx4nWPNVp6o8zA6ZNI= sha1:jbp1eLpxTXhrFTcZ6FMSHLN9+r4=
Xref csiph.com comp.lang.c:69943

Show key headers only | View raw


James: See the parent article.

Tim Rentsch <txr@alumni.caltech.edu> writes:
> David Brown <david.brown@hesbynett.no> writes:
>
>> On 07/09/15 19:04, James Kuyper wrote:
>>> On 09/07/2015 06:22 AM, David Brown wrote:
>>> ...
>>>> However, as far as I can see, "void func(int x[static 100])" means
>>>> almost exactly the same to the compiler as "void func(int x[100])".  The
>>>> compiler is quite happy to view the declaration with the "static" as
>>>> being entirely compatible with those you listed without the "static",
>>>> and it is quite happy to have multiple declarations of the same function
>>>> with different static sizes of the array.
>>>
>>> The key difference is that without the "static", there's undefined
>>> behavior only if the code for func(p) tries to access x[i] for values of
>>> i such that p[i] would have undefined behavior.  With "static 100", it's
>>> also undefined behavior to call the function with a pointer to less than
>>> 100 consecutive accessible 'int' objects, regardless of what func()
>>> actually does with x.
>>
>> That's what I thought was the case, but then Tim confused me by saying
>> that without the "static" there is still undefined behaviour if you
>> call the function with a pointer to less than 100 ints, even if the
>> function does not attempt to access them.  [snip]
>
> I need to give a mea culpa here.  I overlooked that the only
> declaration of g() lacked the static attribute.  I have a partial
> explanation for why that may have happened, but it was a mistake
> on my part.  My apologies to James, to David, and also anyone
> else who may have been mislead or confused.  Also I hope someone
> will arrange for James to get a copy of my apology.

[...]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

who invented static? fir <profesor.fir@gmail.com> - 2015-08-29 11:40 -0700
  Re: who invented static? David Kleinecke <dkleinecke@gmail.com> - 2015-08-29 13:36 -0700
    Re: who invented static? fir <profesor.fir@gmail.com> - 2015-08-29 13:46 -0700
      Re: who invented static? David Kleinecke <dkleinecke@gmail.com> - 2015-08-29 13:53 -0700
        Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-08-29 17:08 -0400
          Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-08-30 16:56 +0200
            Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-08-30 12:18 -0400
              Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-08-30 19:00 +0200
                Re: who invented static? Richard Damon <Richard@Damon-Family.org> - 2015-08-30 13:23 -0400
                Re: who invented static? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-30 21:18 +0100
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 19:33 -0700
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 19:26 -0700
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-08-30 13:40 -0400
                Re: who invented static? supercat@casperkitty.com - 2015-08-31 06:47 -0700
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 19:20 -0700
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 18:59 -0700
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-07 10:25 +0200
                Re: who invented static? Keith Thompson <kst-u@mib.org> - 2015-09-07 01:59 -0700
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-07 12:22 +0200
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-09-07 13:04 -0400
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-07 21:25 +0200
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-09-07 15:47 -0400
                Re: who invented static? Philip Lantz <prl@canterey.us> - 2015-09-07 13:27 -0700
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-09-07 17:31 -0400
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-08 09:16 +0200
                Re: who invented static? Keith Thompson <kst-u@mib.org> - 2015-09-07 13:27 -0700
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-08 09:12 +0200
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-07 16:06 -0700
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-08 09:08 +0200
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-12 11:29 -0700
                Re: who invented static? Keith Thompson <kst-u@mib.org> - 2015-09-08 10:18 -0700
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-09-08 13:28 -0400
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-11 10:07 -0700
                Re: who invented static? Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-12 12:30 -0700
                Re: who invented static? David Brown <david.brown@hesbynett.no> - 2015-09-13 15:48 +0200
                Re: who invented static? supercat@casperkitty.com - 2015-09-29 09:04 -0700
                Re: who invented static? Keith Thompson <kst-u@mib.org> - 2015-09-29 09:18 -0700
                Re: who invented static? supercat@casperkitty.com - 2015-09-29 09:57 -0700
        Re: who invented static? fir <profesor.fir@gmail.com> - 2015-08-29 14:18 -0700
          Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-01 01:36 -0700
    Re: who invented static? Keith Thompson <kst-u@mib.org> - 2015-08-29 14:27 -0700
  Re: who invented static? Siri Cruz <chine.bleu@yahoo.com> - 2015-08-29 14:32 -0700
    Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-29 23:03 +0000
    Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-01 01:52 -0700
      Re: who invented static? Robert Wessel <robertwessel2@yahoo.com> - 2015-09-01 23:42 -0500
        Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-02 00:14 -0700
          Re: who invented static? Richard Heathfield <rjh@cpax.org.uk> - 2015-09-02 08:24 +0100
        Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-04 04:25 +0000
          Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-04 00:45 -0700
            Re: who invented static? Robert Wessel <robertwessel2@yahoo.com> - 2015-09-04 04:09 -0500
              Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-04 02:35 -0700
                Re: who invented static? Robert Wessel <robertwessel2@yahoo.com> - 2015-09-04 23:58 -0500
                Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-05 03:02 -0700
                Re: who invented static? wssimms@gmail.com - 2015-09-05 13:14 -0700
                Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-05 13:49 -0700
                Re: who invented static? Siri Cruz <chine.bleu@yahoo.com> - 2015-09-05 14:09 -0700
                Re: who invented static? gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-05 22:30 +0000
                Re: who invented static? wssimms@gmail.com - 2015-09-05 20:41 -0700
                Re: who invented static? gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-06 05:28 +0000
                Re: who invented static? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-05 22:40 -0700
                Re: who invented static? James Kuyper <jameskuyper@verizon.net> - 2015-09-06 11:42 -0400
                Re: who invented static? Robert Wessel <robertwessel2@yahoo.com> - 2015-09-05 23:38 -0500
                Re: who invented static? raltbos@xs4all.nl (Richard Bos) - 2015-09-27 21:25 +0000
                Re: who invented static? Siri Cruz <chine.bleu@yahoo.com> - 2015-09-27 14:53 -0700
                Re: who invented static? Thomas Richter <thor@math.tu-berlin.de> - 2015-09-29 01:46 +0200
                Re: who invented static? raltbos@xs4all.nl (Richard Bos) - 2015-10-02 12:52 +0000
            Re: who invented static? Siri Cruz <chine.bleu@yahoo.com> - 2015-09-04 02:34 -0700
              Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-04 02:43 -0700
              Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-05 01:30 +0000
                Re: who invented static? Siri Cruz <chine.bleu@yahoo.com> - 2015-09-04 20:52 -0700
                Re: who invented static? Robert Wessel <robertwessel2@yahoo.com> - 2015-09-05 00:03 -0500
                Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-05 09:04 +0000
                Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-05 03:02 -0700
                Re: who invented static? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-05 04:33 -0700
                Re: who invented static? Reinhardt Behm <rbehm@hushmail.com> - 2015-09-05 20:08 +0800
                Re: who invented static? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-05 05:21 -0700
                Re: who invented static? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-05 06:37 -0700
                Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-05 16:54 +0000
                Re: who invented static? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-05 11:06 +0100
                Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-05 03:17 -0700
                Re: who invented static? raltbos@xs4all.nl (Richard Bos) - 2015-09-05 19:14 +0000
                Re: who invented static? fir <profesor.fir@gmail.com> - 2015-09-05 12:59 -0700
            Re: who invented static? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-05 01:24 +0000

csiph-web