[gvd-devel] Bug in GVD-1.2.4 handling templates and empty structures

Arnaud Charlet charlet@ACT-Europe.FR
Fri, 8 Feb 2002 09:56:10 +0100


Thanks for the patch, we will review it carefully.

One comment though:

> +   -------------------
> +   -- Skip_Matching --
> +   -------------------
> +
> +   procedure Skip_Matching
> +     (Type_Str  : String;
> +      Index     : in out Natural;
> +      Opening   : Character;
> +      Closing   : Character)
> +   is
> +      Nesting_Level : Natural := 0;
> +
> +      --  To catch out-of-bounds access or too many closing delimiters
> +      pragma Unsuppress (Range_Check, On => Nesting_Level);
> +      pragma Unsuppress (Index_Check, On => Type_Str);

This isn't very good coding practice to rely on checks being disabled.
Instead you should make Nesting_Level an integer and add checks for
Type_Str (suppressing index_check on an array is very dangerous and can lead
to SEGVs).

Arno