GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #4300

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: Martin Liddle
Subject: Bug report. Problems with initialising sets to the empty set.
Date: 16 Oct 2000, 23:10:24

I believe that I have mentioned this problem previously but have not
been confident that it was a bug.  I am now.  I have repeatedly been hit
by the problem that initialising a set to the empty set will work
correctly for many versions of a program then recompiling the source
without changing anything will produce a version where the set is not
initialised  (I think but am not certain that it is left with whatever
value it had previously).  A typical code snippet might be

Const Maxcomp=180;
Type TSetComp=Set of 1..Maxcomp;
Var SetComp:TSetComp;

begin
 SetComp:=[];
...

Usually this will result in SetComp being the empty set.  Our code uses
sets quite extensively and every so often we will build a version of the
code where one or other of the sets is not initialised.  The behaviour
is then repeatable until we build a new version.  This makes testing a
complete nightmare as we have to test everything each time we build a
new version even if nothing has changed.  The workaround that I have not
seen fail, is to use

SetComp:=[1]-[1];

This is with gpc version 19991030 based on 2.95.2 running under RedHat
Linux 6.2 on a Pentium PC.  To me this smells like an uninitialised
variable in the compiler that only gives problems when it picks up a
limited range of values.  Apologies if this is a known problem (and more
apologies if it is fixed in a later snapshot) but I couldn't immediately
see it in the bug lists.  

Could somebody recommend a strategy for using the daily snapshots?  Is
it a case of taking pot luck or are their particular releases that are
known to work tolerably well?  Is their likely to be a beta in the near
future?

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Replies

Author Subject Date
Frank Heckenbach Bug report. Problems with initialising sets to the empty set. 25 Oct 2000, 10:13:24
Martin Liddle Bug report. Problems with initialising sets to the empty set. 25 Oct 2000, 11:34:01

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).