Hi,
Ian Lance Taylor i...@google.com 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
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 permits
Hi,
Ian Lance Taylor i...@google.com 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 exact
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
Hi,
Ian Lance Taylor i...@google.com skribis:
ludovic.cour...@inria.fr (Ludovic Courtès) writes:
Joseph S. Myers jos...@codesourcery.com 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
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 emit a
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
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)
Hi,
Joseph S. Myers jos...@codesourcery.com 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
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
ludovic.cour...@inria.fr (Ludovic Courtès) writes:
Joseph S. Myers jos...@codesourcery.com 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
11 matches
Mail list logo