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


Groups > comp.lang.c > #69850

Re: who invented static?

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: who invented static?
Date 2015-09-07 17:31 -0400
Organization Self
Message-ID <55EE0214.1080106@verizon.net> (permalink)
References (11 earlier) <msjodd$qjn$1@dont-email.me> <55EDC3A8.3000804@verizon.net> <msko74$ueg$1@dont-email.me> <55EDE9D6.9090204@verizon.net> <MPG.30579326e51a467e5c@news.eternal-september.org>

Show all headers | View raw


On 09/07/2015 04:27 PM, Philip Lantz wrote:
...
> On 07/09/15 03:59, Tim Rentsch wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>> On 30/08/15 18:18, James Kuyper wrote:
>>>> Given:
>>>>
>>>>      void f(int array[static 3]);
>>>>      int large_array[6];
>>>>      int small_array[2];
...
>>> But surely if g were defined:
>>>
>>>     void g(int array[3]);
>>>
>>> Then g(small_array) would still be a constraint violation?
>>
>> No, it isn't.
>>
>>> Or is it
>>> defined behaviour to call g(small_array), and only becomes undefined
>>> if g() accesses array[2] ?
>>
>> No.  A call like g(small_array) is undefined behavior whether
>> code in g() accesses that parameter or not.
> 
> My guess is that when Tim wrote that, he meant to refer to f rather than 
> g. If not, then I'm confused too.

I read precisely that paragraph, looking for precisely that kind of
answer, and didn't notice that Tim gave it. Proofreading is not one of
my strong points.

I gave David a contrary answer to the same question, and now that I've
looked on Google Groups, I see that Tim disagreed with me:

> Someone might want to tell James ... 

The reason he put it that way was that he knows I've got him kill-filed,
even though he's not a troll and is very knowledgeable about C, because
I've found that we often tend to get stuck in long unproductive
arguments. He was hoping someone would quote his message so I could see
it, but nobody did. I hope that this doesn't turn into one of those
arguments.

> ... that the behavior of this call
> is undefined behavior no matter which elements of 'array' g()
> accesses (eg, even if g() function body is empty).  6.7.6.3 p7. 

6.7.6.3p7 indicates that "If the keyword static also appears within the
[ and ] of the array type derivation, then for each call to the
function, the value of the corresponding actual argument shall provide
access to the first element of an array with at least as many
elements as specified by the size expression.". This is "... a shall ...
that appears outside of a constraint ...", so "... the behavior is
undefined." (4p2) when it is violated, but I don't see how that applies
to g(), since "... the keyword static ... " does NOT appear "... within
the [ and ] of the array type derivation ..." in the declaration of g().

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