<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><BLOCKQUOTE>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
I'm being a bit lazy here. I could experiment more with the compiler and check the green book.<BR> <BR> <BR>The compiler does not correctly implement:<BR> <BR> <BR> <BR> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'}; <BR> <BR>at least for reasons of alignment.<BR> <BR> <BR>What is this code supposed to mean?<BR> <BR> <BR>Is ARRAY OF CHAR {'a'} a constant fixed array with a deduced size of 1?<BR>Or a constant open array with a deduced size of 1?<BR>I believe it is supposed to be a constant open array.<BR> <BR> <BR>And then, what is the difference?<BR>What are the visible differences?<BR> <BR> <BR>Between<BR> <BR> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'};<BR>and<BR> VAR a : ARRAY [0..0] OF CHAR := ARRAY [0..0] OF CHAR {'a'};<BR> <BR>Can I act on "a" different at runtime between the two?<BR>Given that its static type is the same, I doubt it. But I haven't really thought about it.<BR> <BR> <BR>If there is no visible difference, should the compiler implement it as the second -- probably saving a tiny bit of space.<BR> <BR> <BR>And if not, is it supposed to generate an open array, and an initializer to do the copy?<BR> <BR> <BR>A constant like<BR>CONST a = ARRAY OF CHAR{'a'}<BR> <BR> <BR>is an open array I believe, with visible differences, I think, not sure,<BR>so in the unlikely even that a "bigger" change is ok here, it has to be careful of this and other scenarios.<BR> <BR> <BR>Really, I'm just being a bit slow. I bet these should remain open arrays but somewhere the compiler gets confused and computes the alignment and perhaps size as a fixed array, leading to assertion failures in the compiler, depending on the actual sizes, e.g.:<BR> <BR> <BR>MODULE Main;<BR><*UNUSED*> VAR a : ARRAY [0..0] OF CHAR := ARRAY OF CHAR {'a'};<BR><*UNUSED*> VAR b : ARRAY OF CHAR := ARRAY OF CHAR {'a'};<BR>BEGIN<BR>END.<BR> <BR> <BR>fails an assertion in the compiler, depending on the target -- but I expect all x86/AMD64 targets.<BR> <BR>Thanks, <BR> - Jay<BR></BLOCKQUOTE></body>
</html>