comp.lang.ada
 help / color / mirror / Atom feed
* Conformance problem in VAX Ada?
@ 1994-12-10  8:54 Dave Papay M/S 7G32 x2791
  1994-12-12 16:10 ` Norman H. Cohen
  1994-12-13  9:05 ` Andreas Schulz RIT14
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Papay M/S 7G32 x2791 @ 1994-12-10  8:54 UTC (permalink / raw)


While writing some code, I accidentally put different default expressions for
a parameter in the declaration and body of a procedure.  Here's what it looked
like, except that procedure Error did some real work ;-) :

   with Text_IO;
   procedure Test is

      procedure Error (I  : in Integer := Integer'First);

      procedure Error (I  : in Integer := Integer'Last) is
      begin
         Text_IO.Put_Line (Integer'Image (I));
      end Error;

   begin
      Error;
   end Test;

I compiled it using VAX Ada v2.3-3 under VAX/VMS v5.5-2.  The compiler didn't
complain, and I didn't discover the error until I started seeing the effects
of using Integer'Last, rather than Integer'First (which is what I really
wanted).  I read over the conformance rules for subprograms, and (as far as I
can determine) I don't think these two specifications conform.  The compiler
thinks they do.  Is this a compiler problem, or am I missing something in the
conformace rules?

                             |         |
David Papay                  |    o    |
papay@acm.org  (preferred)   |  ^/---  |    insert your favorite
dpapay@aol.com (alternate)   |  />     |      disclaimer here
                             |         |
                             | fleche! |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1994-12-16 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-12-10  8:54 Conformance problem in VAX Ada? Dave Papay M/S 7G32 x2791
1994-12-12 16:10 ` Norman H. Cohen
1994-12-16 13:49   ` Robert Dewar
1994-12-13  9:05 ` Andreas Schulz RIT14

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox