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: GCC compiler -Warray-bounds option


On 02/26/2018 02:41 AM, Mustafa i. wrote:
> Hello,
> 
> What exactly is the -Warray-bounds option to the GCC compiler supposed
> to warn about?
It's meant to warn for out of bounds array access.

For example, if you have a 10 element array, but try to access the 11th
element you should get a warning.

The warning is only available when the VRP pass is enabled (VRP is
enabled by default at -O2 and above).

Jeff


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