Re: [BLACKBOX] CONST compiler bug ?

From: [at]} <Robert>
Date: Tue, 24 May 2011 23:29:05 +0100

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

Yes, but ...

INTEGER -> LONGINT is a permitted automatic type promotion; but
going the other way should require an explicit call of SHORT (),
should in not?


Cheers

Robert.



On 24/05/2011 11:24 PM, Douglas G. Danforth wrote:
> Robert,
>
> Interesting. I would assume that since the (numeric) value on the right hand
> side falls within
> the range of an INTEGER that CP is doing a type conversion.
> In fact all of the following work.
>
> PROCEDURE Do*;
> VAR B: BYTE; S: SHORTINT; N: INTEGER; R: REAL;
> BEGIN
> B := 1L;
> S := 1L;
> N := 1L;
> R := 1L;
> END Do;
>
> -Doug Danforth
>
>
> On 5/24/2011 9:04 AM, Campbell, Robert (SELEX GALILEO, UK) wrote:
>> I don't think the code below should compile or run, but it seems to.
>> Am I missing something?
>> Cheers
>> Robert
>> PROCEDURE Foo*;
>> VAR
>> n : INTEGER;
>> BEGIN
>> n := 1L
>> END Foo;
>>
> --------------------------------------------------------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 10.0.1375 / Virus Database: 1509/3656 - Release Date: 05/23/11
>
> ---- 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-1556587278_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9f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0tLS1ccGFyDQpUbyB1bnN1YnNjcmliZSwg
c2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9YIiB0byBMSVNUU0VSVkBM
SVNUUy5PQkVST04uQ0hccGFyDQp9
----boundary-LibPST-iamunique-1556587278_-_---
Received on Wed May 25 2011 - 00:29:05 UTC

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