summarylogtreecommitdiffstats
path: root/0003-gm2-fix-bad-programming-practice-warning.patch
blob: 7f269128b3ce846b8a1a3e2b29cd941093bbf4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From 4a6165ca76af7fe5c7fdd4db48293aafa2abafda Mon Sep 17 00:00:00 2001
From: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Date: Wed, 24 Jul 2024 10:54:15 +0200
Subject: [PATCH] gm2: fix bad programming practice warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To: gcc-patches@gcc.gnu.org
Cc: Gaius Mulley <gaiusmod2@gmail.com>

Fix identifier names to be too similar to Modula-2 keywords and causing
warnings coming from Modula-2's own libraries.

m2/m2iso/StdChans.mod:54:20: note: In implementation module ‘StdChans’:
either the identifier has the same name as a keyword or alternatively a
keyword has the wrong case (‘IN’ and ‘in’)
   54 |    stdnull: ChanId ;

m2/m2iso/StdChans.mod:54:20: note: the symbol name ‘in’ is legal as an
identifier, however as such it might cause confusion and is considered
bad programming practice

gcc/gm2:
        * gm2-libs-iso/StdChans.mod: Fix bad identifier warning.

Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
---
 gcc/m2/gm2-libs-iso/StdChans.mod | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/gcc/m2/gm2-libs-iso/StdChans.mod b/gcc/m2/gm2-libs-iso/StdChans.mod
index fbefbde4b10..e15d4ef9580 100644
--- a/gcc/m2/gm2-libs-iso/StdChans.mod
+++ b/gcc/m2/gm2-libs-iso/StdChans.mod
@@ -45,9 +45,9 @@ FROM RTgen IMPORT ChanDev, DeviceType,
 
 
 VAR
-   in,
-   out,
-   err,
+   inch,
+   outch,
+   errch,
    stdin,
    stdout,
    stderr,
@@ -169,21 +169,21 @@ END NullChan ;
 PROCEDURE InChan () : ChanId ;
   (* Returns the identity of the current default input channel. *)
 BEGIN
-   RETURN( in )
+   RETURN( inch )
 END InChan ;
 
 
 PROCEDURE OutChan () : ChanId ;
   (* Returns the identity of the current default output channel. *)
 BEGIN
-   RETURN( out )
+   RETURN( outch )
 END OutChan ;
 
 
 PROCEDURE ErrChan () : ChanId ;
   (* Returns the identity of the current default error message channel. *)
 BEGIN
-   RETURN( err )
+   RETURN( errch )
 END ErrChan ;
 
   (* The following procedures allow for redirection of the default channels *)
@@ -191,21 +191,21 @@ END ErrChan ;
 PROCEDURE SetInChan (cid: ChanId) ;
   (* Sets the current default input channel to that identified by cid. *)
 BEGIN
-   in := cid
+   inch := cid
 END SetInChan ;
 
 
 PROCEDURE SetOutChan (cid: ChanId) ;
   (* Sets the current default output channel to that identified by cid. *)
 BEGIN
-   out := cid
+   outch := cid
 END SetOutChan ;
 
 
 PROCEDURE SetErrChan (cid: ChanId) ;
   (* Sets the current default error channel to that identified by cid. *)
 BEGIN
-   err := cid
+   errch := cid
 END SetErrChan ;
 
 
@@ -303,9 +303,9 @@ END Init ;
 BEGIN
    Init
 FINALLY
-   SafeClose(in) ;
-   SafeClose(out) ;
-   SafeClose(err) ;
+   SafeClose(inch) ;
+   SafeClose(outch) ;
+   SafeClose(errch) ;
    SafeClose(stdin) ;
    SafeClose(stdout) ;
    SafeClose(stderr)
-- 
2.45.2