[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Improved subrange error message accuracy
From: |
Gaius Mulley |
Subject: |
Improved subrange error message accuracy |
Date: |
Mon, 13 Jan 2025 14:54:49 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi,
just a heads up, I've improved the subrange error accuracy. Prior to
the fix this code provoked the following error messages:
$ cat badparamset2.mod
MODULE badparamset2 ;
TYPE
month = SET OF [1..12] ;
day = SET OF [1..31] ;
PROCEDURE foo (d: day) ;
BEGIN
END foo ;
VAR
m: month ;
BEGIN
foo (m)
END badparamset2.
$ gm2 badparamset2.mod
badparamset2.mod:15:9: error: 1st parameter failure due to assignment
incompatibility between actual parameter ‘m’ and the 1st formal ‘d’ parameter
in procedure ‘foo’
15 | foo (m)
| ^
badparamset2.mod:15:9: error: subrange and subrange are incompatible as formal
and actual procedure parameters
With the latest gcc git:
$ gm2 badparamset2.mod
badparamset2.mod:15:9: error: 1st parameter failure due to assignment
incompatibility between actual parameter ‘m’ and the 1st formal ‘d’ parameter
in procedure ‘foo’
15 | foo (m)
| ^
badparamset2.mod:4:19: error: actual parameter subrange
4 | month = SET OF [1..12] ;
| ^~~~~~~
badparamset2.mod:5:17: error: formal parameter subrange
5 | day = SET OF [1..31] ;
| ^~~~~~~
regards,
Gaius
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Improved subrange error message accuracy,
Gaius Mulley <=