|
From: | Alice Osako |
Subject: | Re: Unusual compiler error: 'unable to obtain the MIN value for type the ZType' |
Date: | Fri, 8 Mar 2024 05:33:30 -0500 |
User-agent: | Mozilla Thunderbird |
Benjamin Kowarsch:
The root cause of the error is most likely the expression cp IN ASCIIRangebecause cp (of type CARDINAL) is probably incompatible with the underlying type of ASCIIRange.Modula-2 follows name equivalence and unlike C it does not use type promotion.You could try to define ASCIIRange explicitly as a subtype of CARDINAL. TYPE ASCIIRange = CARDINAL [32..127]; Or simply test against the boundaries. CONST Min7BitPrinatble = 32; Max7BitPrintable = 127; IF (cp >= Min7BitPrintable) AND (cp <= Max7BitPrintable) THEN ... END;
Ah, that explains it. Specifying ASCIIRange as a subtype of CARDINAL solves this problem, as well as two similar issues I had overlooked until now. The code as it is now does compile, thank you.
I will try working on some simple tests for the UTF-32 representation next, before addressing the UTF-8 to UTF-32 translations.
[Prev in Thread] | Current Thread | [Next in Thread] |