This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dimensions of array parameters


ludovic.courtes@inria.fr (Ludovic CourtÃs) writes:

> "Joseph S. Myers" <joseph@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 could do
> static bound checking and/or generate bound checking code.

The ABI for a C function does not provide any way to pass down the
dimensions of an array.  Any such change would mean that you would have
to recompiled the whole world, including the C library.  In practice
that is not going to happen.

GCC can already generate bounds checking code via -fmudflap.  It works
by recording the bounds in the memory area, not in the function
arguments.  There is also Valgrind and AddresSanitizer.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]