https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94419

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
                 CC|                            |ebotcazou at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-04-04

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Please, note Ada is not C, Ada is about safety. A program should be checked
> for corectness and any errors must be reported almost always, at runtime
> also. There are also cases when checks would be too hard to implement, but
> those cases are relatively rare, they ever need more arguments, than
> implementation complexity.

Well, GNAT passes 100% of the tests of the ACATS testsuites, which contain
thousands of correctness tests, so finding some bugs cannot be a pretext for
depreciating it as you do.  Every complex software has bugs, a compiler is a
complex software, ergo it has bugs.

You don't cite the clauses of the Ada RM that would make your program illegal
and you don't say which version of GNAT you use so there isn't much we can do.

> Another bad thing in GNAT is implementation of "mutable" records, they
> always need maximum memory. It is from GNAT manual:
> type Rec (D : Positive := 15) is record
>        Name : String (1..D);
>     end record;
> 
>     Too_Large : Rec;
> 
> is flagged by the compiler with a warning: an attempt to create
> `Too_Large' will raise `Storage_Error', because the required size
> includes `Positive'Last' bytes.
> 
> It is bad. I think such records should be dynamically reallocatable. GNAT
> manual says that such way is improper, but it is not that, it is right.

No, it's just a trade off and GNAT has selected this implementation.  But you
can certainly write your own Ada compiler with another implementation.

Reply via email to