From: Stephen Leake on
Robert A Duff <bobduff(a)shell01.TheWorld.com> writes:

> Stephen Leake <stephen_leake(a)stephe-leake.org> writes:
>
>> Robert A Duff <bobduff(a)shell01.TheWorld.com> writes:
>>
>>> Adam Beneschan <adam(a)irvine.com> writes:
>>>
>>>>...And that
>>>> issue exists with GNAT also---you delete some files from your
>>>> directory with a wildcard, somehow foo.adb accidentally gets deleted
>>>> along with them, and the compiler still thinks your program is OK.
>>>
>>> Seems unlikely.
>>
>> Which means it will be very hard/confusing to debug when it does
>> happen, since you will not be familiar with the problem. So it is
>> important for the tool to handle the unlikely situations nicely.
>
> I suppose...
>
>>> Here's a similar issue: One reasonable design pattern is to have
>>> a body that contains a type extension, which registers itself
>>> into some global data structure. All calls to this thing
>>> are indirect (via the parent's 'Class). Nobody needs visibility
>>> on this thing, so its spec is completely empty, except for
>>> the obligatory pragma Elaborate_Body. Unfortunately, if you
>>> forget to 'with' it, it will be silently ignored.
>>
>> And if you do 'with' it, GNAT will complain that it's unnecessary, so
>> you have to put a pragma Warnings (off) on it. QtAda does this for
>> some stuff; it's annoying.
>
> But that's a hugely useful warning. Without it, you end up with
> useless 'with's accumulating in your code. An occassional
> pragma Warnings is well worth the trouble, IMHO.

Yes, I agree.

Actually, most of the annoyance is that Emacs Ada mode doesn't
understand about the pragma, so when it automatically adds a new with
clause, and alphabetically sorts the set of with clauses, it messes
things up. So I need to teach Emacs Ada mode how to cope with that
better.

--
-- Stephe