From: Cary Jamison <cary@svl.trw.com>
Subject: Re: GNAT messages and the not operator (pitfall alert!)
Date: 1996/10/28
Date: 1996-10-28T00:00:00+00:00 [thread overview]
Message-ID: <3275A12F.B8F@svl.trw.com> (raw)
In-Reply-To: dewar.846162354@merv
Robert Dewar wrote:
[...]
RD> Consider this program, which we now, as you see, generate a warning for:
RD>
RD> 1. with Text_IO; use Text_IO;
RD> 2. procedure t1 is
RD> 3. type m is mod 256;
RD> 4. a : m := 4;
RD> 5. b : m := 5;
RD> 6. begin
RD> 7. if not a < b then
RD> |
RD> >>> warning: operand of not operator should be parenthesized
RD>
RD> 8. Put_Line ("this is what I expect");
RD> 9. else
RD> 10. Put_Line ("but this is what I get!");
RD> 11. end if;
RD> 12.
RD> 13. if (not a) < b then
RD> 14. Put_Line ("this is not what I expect");
RD> 15. else
RD> 16. Put_Line ("this is what I get, and I really asked for it!");
RD> 17. end if;
RD> 18. end;
RD>
RD> I think this warning is quite reasonable, since I would *really* like people
RD> to use parens if they really want the situation shown on line 13!
But, shouldn't the warning be "not expression should be parenthesized"? I think
the "operand of not operator" would just be the 7, i.e. "not (7)" instead of "(not 7)".
--
Cary Jamison
TRW SIG
cary@svl.trw.com
next prev parent reply other threads:[~1996-10-28 0:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-10-24 0:00 GNAT messages and the not operator (pitfall alert!) Robert Dewar
1996-10-24 0:00 ` Robert Dewar
1996-10-25 0:00 ` whiting_ms@corning.com (Matt Whiting)
1996-10-26 0:00 ` David C. Hoos, Sr.
1996-10-27 0:00 ` Robert Dewar
1996-10-28 0:00 ` Matthew S. Whiting
1996-10-26 0:00 ` John Herro
1996-10-26 0:00 ` Matthew Heaney
1996-10-29 0:00 ` Robert Dewar
1996-10-26 0:00 ` Robert Dewar
1996-10-29 0:00 ` John Herro
1996-10-29 0:00 ` Robert Dewar
1996-10-30 0:00 ` Dr. Peter E. Obermayer
1996-10-30 0:00 ` John Herro
1996-10-30 0:00 ` Robert Dewar
1996-11-01 0:00 ` User Password expiration date extractor? Stein-Aksel Basma
1996-10-29 0:00 ` GNAT messages and the not operator (pitfall alert!) Norman H. Cohen
1996-10-29 0:00 ` whiting_ms@corning.com (Matt Whiting)
1996-10-30 0:00 ` Robert Dewar
1996-10-30 0:00 ` David C. Hoos, Sr.
1996-10-30 0:00 ` whiting_ms@corning.com (Matt Whiting)
1996-10-30 0:00 ` Norman H. Cohen
1996-10-30 0:00 ` Norman H. Cohen
1996-11-06 0:00 ` Richard A. O'Keefe
1996-11-18 0:00 ` Norman H. Cohen
1996-11-18 0:00 ` Robert Dewar
1996-11-05 0:00 ` Robert Dewar
1996-10-28 0:00 ` Cary Jamison [this message]
1996-10-29 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox