Re: What does -gnato do?



Martin Krischik <krischik@xxxxxxxxxxxxxxxxxxxxx> wrote in
news:1636357.gWrtX1Nq9K@xxxxxxxxxxxxxxxxxxx:

-gnato enables runtime checks but the warning results from a compile
time check. The ability to make quite a lot of checks at compile time
- rather then runtime - is a is one great advantage of the Ada Syntax
and Sematic:

You are right in that if I do the overflow with values that can only be
known at run time, the -gnato makes a difference. Without the option,
the results wrap around but with the option I get Constraint_Error.

So it seems that without -gnato the externally visible behavior of a
program depends on the extent with which the compiler can analyze the
code. If the compiler's analysis is sufficiently deep I might end up
with a Constraint_Error that I wouldn't get if the analysis was not as
deep. I'm not sure how I feel about that. It seems like a bad idea to me
although I can't articulate exactly why I feel that way.

Peter
.



Relevant Pages

  • Re: OOP and memory management
    ... if the ability to catch some errors at compile time ... "The project is a complete and utter failure. ... We haven't even been able to write the code clean enough to get it to compile ...
    (comp.programming)
  • Re: What are the advantages of .NET 2.0 over NET 1.1 ?
    ... Nullable types will be a big plus: the ability to handle ... Generics will be the heavy hitter. ... I've lost count of the classes I've ... debugging problems that I could have found at compile time if I had ...
    (microsoft.public.dotnet.languages.csharp)