ludovic.cour...@inria.fr (Ludovic Courtès) writes:
> Declaring the parameter above as ‘int x[a]’ is valid C99. I fail to see
> why this is insufficient for the purposes we discussed. Could you clarify?
Sorry, I hadn't realized that C99 permitted that. The standard does
clearly state that in pr
On Tue, 6 Dec 2011, Ludovic Court�s wrote:
> > extern void foo (int a, int x[__attribute__ ((dim (a)))])
> >
> > could be implemented.
>
> Why use special syntax for this? It seems to me that int x[a] conveys
> the exact same information.
No, int x[static a] conveys that information - note the
Hi,
Ian Lance Taylor skribis:
> ludovic.cour...@inria.fr (Ludovic Courtès) writes:
>
>>> Perhaps something like
>>>
>>> extern void foo (int a, int x[__attribute__ ((dim (a)))])
>>>
>>> could be implemented.
>>
>> Why use special syntax for this? It seems to me that ‘int x[a]’ conveys
>> the ex
ludovic.cour...@inria.fr (Ludovic Courtès) writes:
>> Perhaps something like
>>
>> extern void foo (int a, int x[__attribute__ ((dim (a)))])
>>
>> could be implemented.
>
> Why use special syntax for this? It seems to me that ‘int x[a]’ conveys
> the exact same information.
Using special syntax
Hi,
Ian Lance Taylor skribis:
> ludovic.cour...@inria.fr (Ludovic Courtès) writes:
>
>> I understand. However, I’m concerned about keeping the information at
>> compile-time. For example:
>>
>> extern void foo (int a, int x[a]);
>> static void bar (void) {
>> int x[123];
>> foo (45
ludovic.cour...@inria.fr (Ludovic Courtès) writes:
> I understand. However, I’m concerned about keeping the information at
> compile-time. For example:
>
> extern void foo (int a, int x[a]);
> static void bar (void) {
> int x[123];
> foo (456, x);
> }
>
> Here the compiler could em
Hi,
Ian Lance Taylor skribis:
> ludovic.cour...@inria.fr (Ludovic Courtès) writes:
>
>> "Joseph S. Myers" skribis:
>>
>>> On Fri, 2 Dec 2011, Ludovic Courtès wrote:
>>>
Is there a way array dimension info could be preserved?
>>>
>>> Perhaps you could explain the actual problem you are tryi
ludovic.cour...@inria.fr (Ludovic Courtès) writes:
> "Joseph S. Myers" skribis:
>
>> On Fri, 2 Dec 2011, Ludovic Courtès wrote:
>>
>>> Is there a way array dimension info could be preserved?
>>
>> Perhaps you could explain the actual problem you are trying to solve?
>
> I’m just thinking that, if
On Fri, 2 Dec 2011, Ludovic Court�s wrote:
> I'm just thinking that, if that information were preserved, GCC could do
> static bound checking and/or generate bound checking code.
As I noted, that would be contrary to the language semantics unless
[static] is used.
--
Joseph S. Myers
jos...@cod
Hi,
"Joseph S. Myers" skribis:
> On Fri, 2 Dec 2011, Ludovic Courtès wrote:
>
>> Is there a way array dimension info could be preserved?
>
> Perhaps you could explain the actual problem you are trying to solve?
I’m just thinking that, if that information were preserved, GCC could do
static boun
On Fri, 2 Dec 2011, Ludovic Court�s wrote:
> Is there a way array dimension info could be preserved?
Perhaps you could explain the actual problem you are trying to solve? The
value of such a dimension is specified in the C standard to be checked for
constraint violations (such as being <= 0) b
Hello,
Parameters that have an array type (fixed-length or variable-length) are
internally converted to have a pointer type instead (this is with 4.6.)
For example:
static int
bar (int foo[12])
{
return foo[2];
}
is turned into:
bar (unsigned int x, int * foo)
...
Is there a wa
12 matches
Mail list logo