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


Groups > comp.lang.c > #2932

Re: multidimensional heap arrays

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: multidimensional heap arrays
Date 2011-04-27 08:59 +1200
Message-ID <91oq24Fq9bU9@mid.individual.net> (permalink)
References (2 earlier) <509bd6d5-21c0-4150-9aa4-7e68492782f1@v10g2000yqn.googlegroups.com> <4db663d9$0$4789$426a74cc@news.free.fr> <0.ba05a251a5fe8eed2ac7.20110426121957BST.8739l5dztu.fsf@bsb.me.uk> <91noctFq9bU7@mid.individual.net> <0.bece330a32ff7f1d21e3.20110426210623BST.87r58odbgg.fsf@bsb.me.uk>

Show all headers | View raw


On 04/27/11 08:06 AM, Ben Bacarisse wrote:
> Ian Collins<ian-news@hotmail.com>  writes:
>
>> On 04/26/11 11:19 PM, Ben Bacarisse wrote:
>>> Francois Grieu<fgrieu@gmail.com>   writes:
>>>
>>>> On 26/04/2011 06:19, Anand Hariharan wrote:
>>>
>>>>> or will the 'arr' in the following code be a 'plain and ordinary'
>>>>> array ...
>>>>>
>>>>> const int ncol = 5;
>>>>> int arr[ncol];
>>>
>>> The former.  This is a VLA and will remain so in C1x.
>>>
>>>> I'm genuinely wondering: is ncol a "constant expression" ?
>>>
>>> It might be in that an implementation can define its own forms of
>>> constant expression, but it does not meet the standard's minimum
>>> requirements to be an "integer constant expression" (which is what is
>>> required to declare a non-VL array).
>>
>> Which is really silly.  I do wish they could fix that and bring it in
>> line with C++.  But I guess adding VLAs shot that idea in the foot.
>
> I too would like to have seen the same constant expression definition
> between C++ and C but I don't see how C's VLAs got in the way of that.

The code above sums it up, if ncol is an "integer constant expression" 
is arr an array, or a VLA?

Would it be acceptable for a language change to change (all be it 
subtly) the behaviour of existing code?

-- 
Ian Collins

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


Thread

multidimensional heap arrays Jack Boot <jackboot@mailinator.com> - 2011-04-25 19:36 +0000
  Re: multidimensional heap arrays Francois Grieu <fgrieu@gmail.com> - 2011-04-25 23:16 +0200
  Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-25 22:35 +0100
    Re: multidimensional heap arrays Anand Hariharan <mailto.anand.hariharan@gmail.com> - 2011-04-25 21:19 -0700
      Re: multidimensional heap arrays Francois Grieu <fgrieu@gmail.com> - 2011-04-26 08:19 +0200
        Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-26 12:19 +0100
          Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-26 23:25 +1200
            Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-26 21:06 +0100
              Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 08:59 +1200
                Re: multidimensional heap arrays Keith Thompson <kst-u@mib.org> - 2011-04-26 14:39 -0700
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 10:03 +1200
                Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-26 23:41 +0100
                Re: multidimensional heap arrays Keith Thompson <kst-u@mib.org> - 2011-04-26 16:33 -0700
                Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-27 04:05 +0100
                Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-26 22:49 +0100
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 10:19 +1200
                Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-27 00:38 +0100
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 11:48 +1200
                Re: multidimensional heap arrays Keith Thompson <kst-u@mib.org> - 2011-04-26 17:38 -0700
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 13:08 +1200
                Re: multidimensional heap arrays Tim Rentsch <txr@alumni.caltech.edu> - 2011-04-26 18:31 -0700
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 14:01 +1200
                Re: multidimensional heap arrays Tim Rentsch <txr@alumni.caltech.edu> - 2011-04-27 00:04 -0700
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 19:58 +1200
                Re: multidimensional heap arrays Ian Collins <ian-news@hotmail.com> - 2011-04-27 20:03 +1200
                Re: multidimensional heap arrays Keith Thompson <kst-u@mib.org> - 2011-04-27 00:03 -0700
                Re: multidimensional heap arrays Tim Rentsch <txr@alumni.caltech.edu> - 2011-04-26 18:20 -0700
                Re: multidimensional heap arrays Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-27 03:59 +0100
                Re: multidimensional heap arrays Tim Rentsch <txr@alumni.caltech.edu> - 2011-04-27 00:24 -0700
    Re: multidimensional heap arrays "io_x" <a@b.c.invalid> - 2011-04-26 09:42 +0200
  Re: multidimensional heap arrays Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-04-25 20:50 -0400
  Re: multidimensional heap arrays James Kuyper <jameskuyper@verizon.net> - 2011-04-25 22:57 -0400

csiph-web