public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "listor1 dot rombobeorn at comhem dot se" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/25245] Discriminant is left uninitialized.
Date: Fri, 09 Dec 2005 22:35:00 -0000	[thread overview]
Message-ID: <20051209223505.22945.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25245-5982@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from listor1 dot rombobeorn at comhem dot se  2005-12-09 22:35 -------
Subject: Re:  Discriminant is left uninitialized.

> But the constraint_error for "OS of A1b" looks correct, and if commented
> the one on "OS of A2b", it is a language mandated discriminant check
> failing. But may be I'm missing something, could you explain why you think
> an exception shouldn't be raised?

The discriminant check fails because OS doesn't contain any of the valid 
values 0, 1 or 2 (for NT, OS2 and Linux). If there is random data in the 
memory I expect a 3/256 chance that it will get a valid value.

The OS field shouldn't be random. It's fixed to Linux in the definition of 
Character_Encoding_A:

   This_OS : constant Known_OS := Linux;
   type Character_Encoding_A (Known : Boolean := False) is
     new Unified_Encoding_Record (Known => Known, OS => This_OS);

All objects of this type should therefore have OS=Linux, so the discriminant 
would be valid and would pass the check.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25245


  parent reply	other threads:[~2005-12-09 22:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-03 17:52 [Bug ada/25245] New: " listor1 dot rombobeorn at comhem dot se
2005-12-03 17:54 ` [Bug ada/25245] " listor1 dot rombobeorn at comhem dot se
2005-12-03 17:55 ` listor1 dot rombobeorn at comhem dot se
2005-12-04 21:11 ` laurent at guerby dot net
2005-12-05 19:54 ` laurent at guerby dot net
2005-12-06 22:21 ` listor1 dot rombobeorn at comhem dot se
2005-12-09 19:51 ` laurent at guerby dot net
2005-12-09 22:35 ` listor1 dot rombobeorn at comhem dot se [this message]
2005-12-10 13:26 ` laurent at guerby dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051209223505.22945.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).