Re: [BLACKBOX] Possible compiler bug ?

From: [at]} <Bernhard>
Date: Sun, 18 Dec 2011 12:42:55 +0100

----boundary-LibPST-iamunique-972917810_-_-
Content-type: text/plain

Hi Robert,

it is not absolutely clear to me, what you try to achieve with LONG(100),
but I guess you want to force BB to use LONGINT ...

When I replace LONG(100) by plain 100, it compiles ok.

But any other of the following trap:

pos := SHORT (LONG(val) * LONG(100) DIV meter.maxVal)

pos := SHORT (LONG(val) * 100 DIV meter.maxVal)
pos := SHORT (val * 100 DIV LONG(meter.maxVal))

   pos : INTEGER;
   val : LONGINT;
   meter : Meter;
BEGIN
    pos := SHORT (val * 100 DIV meter.maxVal)

The Language report says (8.2.2)
    The type of the result is [...] LONGINT if one of the operand types is
    LONGINT, or INTEGER in any other case.

I think you really found a compiler bug ...

Bernhard

----- Original Message -----
From: "Robert" <robert.campbell_{([at]})nowhere.xy
To: <BLACKBOX{([at]})nowhere.xy
Sent: Sunday, December 18, 2011 10:34 AM
Subject: [BLACKBOX] Possible compiler bug ?


> Hi
>
> I can't compile the code below, which seems ok to me.
>
> I don't get an error message, I get a compiler crash.
>
> Am I overlooking something obvious?
>
> Regards
>
> Robert
>
>
>
> MODULE DemoMeter;
>
>
> TYPE
> Meter = POINTER TO RECORD
> maxVal : INTEGER;
> END;
>
>
> PROCEDURE Do*;
> VAR
> pos, val : INTEGER;
> meter : Meter;
> BEGIN
> pos := SHORT (val * LONG (100) DIV meter.maxVal)
> END Do;
>
>
> END DemoMeter.
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-972917810_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lz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hcg0KPiAgIE1ldGVyICA9ICBQ
T0lOVEVSICBUTyAgUkVDT1JEXHBhcg0KPiAgICAgICAgICAgICAgIG1heFZhbCAgOiAgSU5URUdF
UjtccGFyDQo+ICAgICAgICAgICAgICBFTkQ7XHBhcg0KPlxwYXINCj5ccGFyDQo+IFBST0NFRFVS
RSAgRG8qO1xwYXINCj4gICBWQVJccGFyDQo+ICAgICBwb3MsIHZhbCAgOiAgSU5URUdFUjtccGFy
DQo+ICAgICBtZXRlciAgICAgOiAgTWV0ZXI7XHBhcg0KPiAgIEJFR0lOXHBhcg0KPiAgICAgIHBv
cyAgOj0gIFNIT1JUICh2YWwgKiBMT05HICgxMDApICBESVYgIG1ldGVyLm1heFZhbClccGFyDQo+
ICAgRU5EICBEbztccGFyDQo+XHBhcg0KPlxwYXINCj4gRU5EICBEZW1vTWV0ZXIuXHBhcg0KPlxw
YXINCj5ccGFyDQo+IC0tLS1ccGFyDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3
aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIFxwYXINCj4gTElTVFNFUlZATElTVFMuT0JF
Uk9OLkNIIFxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwgc2VuZCBh
IG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBMSVNUUy5P
QkVST04uQ0h9fQANCg0K
----boundary-LibPST-iamunique-972917810_-_---
Received on Sun Dec 18 2011 - 12:42:55 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:09 UTC