aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2023-12-12 19:29:06 +0000
committerGaius Mulley <gaiusmod2@gmail.com>2023-12-12 19:29:06 +0000
commit01cca857aa3e86a750f5df77ca6c36c0739f10f0 (patch)
tree3be731b779ffab7fc9fe34de03fcf8425230b06b
parentf4d8ab192d8c9f540cf19a0906d68a0f52fdef60 (diff)
downloadgcc-01cca857aa3e86a750f5df77ca6c36c0739f10f0.zip
gcc-01cca857aa3e86a750f5df77ca6c36c0739f10f0.tar.gz
gcc-01cca857aa3e86a750f5df77ca6c36c0739f10f0.tar.bz2
PR modula2/112984 Compiling program with -Wpedantic shows warning in libraries
This patch tidies up the library modules so that -Wpedantic does not generate any warnings (apart from two procedures with legitimate infinite loops). gcc/m2/ChangeLog: PR modula2/112984 * gm2-libs-coroutines/SYSTEM.mod: Remove redundant import of memcpy. * gm2-libs-iso/ClientSocket.mod: Remove redundant import of IOConsts. * gm2-libs-iso/IOChan.mod: Remove redundant import of IOConsts. * gm2-libs-iso/IOLink.mod: Remove redundant import of IOChan and SYSTEM. * gm2-libs-iso/IOResult.mod: Remove redundant import of IOChan. * gm2-libs-iso/LongIO.mod: Remove redundant import of writeString. * gm2-libs-iso/LongWholeIO.mod: Remove redundant import of IOChan. * gm2-libs-iso/M2RTS.mod: Remove redundant import of ADDRESS. * gm2-libs-iso/MemStream.mod: Remove redundant import of ADDRESS. * gm2-libs-iso/RTdata.mod: Remove redundant import of DeviceTablePtr. * gm2-libs-iso/RTfio.mod: Remove redundant import of DeviceTablePtr. * gm2-libs-iso/RTgen.mod: Remove redundant import of DeviceTablePtr. * gm2-libs-iso/RealIO.mod: Remove redundant import of writeString. * gm2-libs-iso/RndFile.mod: Remove redundant import of SYSTEM. * gm2-libs-iso/SYSTEM.mod: Remove redundant import of memcpy. * gm2-libs-iso/ShortWholeIO.mod: Remove redundant import of IOConsts. * gm2-libs-iso/TextIO.mod: Remove redundant import of IOChan. * gm2-libs-iso/TextUtil.mod: Remove redundant import of IOChan. * gm2-libs-iso/WholeIO.mod: Remove redundant import of IOChan. * gm2-libs-log/BitByteOps.mod: Remove redundant import of BYTE. * gm2-libs-log/FileSystem.mod: Remove redundant import of BYTE and ADDRESS. * gm2-libs-log/InOut.mod: Remove redundant import of String. * gm2-libs-log/RealConversions.mod: Remove redundant import of StringToLongreal. * gm2-libs/FIO.mod: Remove redundant import of SIZE. * gm2-libs/FormatStrings.mod: Remove redundant import of String and ConCatChar. * gm2-libs/IO.mod: Remove redundant import of SIZE. * gm2-libs/Indexing.mod: Remove redundant import of ADDRESS. * gm2-libs/M2Dependent.mod: Remove redundant import of SIZE. * gm2-libs/M2RTS.mod: Remove redundant import of ADDRESS. * gm2-libs/OptLib.mod: Remove redundant import of DynamicStrings. * gm2-libs/SYSTEM.mod: Remove redundant import of memcpy. * gm2-libs/StringConvert.mod: Remove redundant import of String. libgm2/ChangeLog: * libm2iso/Makefile.am (libm2iso_la_M2FLAGS): Added line breaks. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.am (libm2log_la_M2FLAGS): Added line breaks. * libm2log/Makefile.in: Regenerate. * libm2pim/Makefile.am (libm2pim_la_M2FLAGS): Added line breaks. * libm2pim/Makefile.in: Regenerate. gcc/testsuite/ChangeLog: PR modula2/112984 * gm2/switches/pedantic/pass/hello.mod: New test. * gm2/switches/pedantic/pass/switches-pedantic-pass.exp: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
-rw-r--r--gcc/m2/gm2-libs-coroutines/SYSTEM.mod4
-rw-r--r--gcc/m2/gm2-libs-iso/ClientSocket.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/IOChan.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/IOLink.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/IOResult.mod1
-rw-r--r--gcc/m2/gm2-libs-iso/LongIO.mod4
-rw-r--r--gcc/m2/gm2-libs-iso/LongWholeIO.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/M2RTS.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/MemStream.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/RTdata.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/RTfio.mod6
-rw-r--r--gcc/m2/gm2-libs-iso/RTgen.mod7
-rw-r--r--gcc/m2/gm2-libs-iso/RealIO.mod4
-rw-r--r--gcc/m2/gm2-libs-iso/RndFile.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/SYSTEM.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/ShortWholeIO.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/TextIO.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/TextUtil.mod2
-rw-r--r--gcc/m2/gm2-libs-iso/WholeIO.mod1
-rw-r--r--gcc/m2/gm2-libs-log/BitByteOps.mod2
-rw-r--r--gcc/m2/gm2-libs-log/FileSystem.mod6
-rw-r--r--gcc/m2/gm2-libs-log/InOut.mod2
-rw-r--r--gcc/m2/gm2-libs-log/RealConversions.mod2
-rw-r--r--gcc/m2/gm2-libs/FIO.mod2
-rw-r--r--gcc/m2/gm2-libs/FormatStrings.mod4
-rw-r--r--gcc/m2/gm2-libs/IO.mod2
-rw-r--r--gcc/m2/gm2-libs/Indexing.mod2
-rw-r--r--gcc/m2/gm2-libs/M2Dependent.mod2
-rw-r--r--gcc/m2/gm2-libs/M2RTS.mod2
-rw-r--r--gcc/m2/gm2-libs/OptLib.mod1
-rw-r--r--gcc/m2/gm2-libs/SYSTEM.mod2
-rw-r--r--gcc/m2/gm2-libs/StringConvert.mod2
-rw-r--r--gcc/testsuite/gm2/switches/pedantic/pass/hello.mod8
-rw-r--r--gcc/testsuite/gm2/switches/pedantic/pass/switches-pedantic-pass.exp38
-rw-r--r--libgm2/libm2iso/Makefile.am3
-rw-r--r--libgm2/libm2iso/Makefile.in3
-rw-r--r--libgm2/libm2log/Makefile.am3
-rw-r--r--libgm2/libm2log/Makefile.in3
-rw-r--r--libgm2/libm2pim/Makefile.am3
-rw-r--r--libgm2/libm2pim/Makefile.in3
40 files changed, 93 insertions, 53 deletions
diff --git a/gcc/m2/gm2-libs-coroutines/SYSTEM.mod b/gcc/m2/gm2-libs-coroutines/SYSTEM.mod
index 3652dec..f8ec6d7 100644
--- a/gcc/m2/gm2-libs-coroutines/SYSTEM.mod
+++ b/gcc/m2/gm2-libs-coroutines/SYSTEM.mod
@@ -35,7 +35,7 @@ IMPORT RTint ;
FROM Storage IMPORT ALLOCATE ;
FROM M2RTS IMPORT Halt ;
-FROM libc IMPORT printf, memcpy, memcpy, memset ;
+FROM libc IMPORT printf, memcpy, memset ;
CONST
@@ -51,7 +51,7 @@ TYPE
VAR
initMain,
- initGTh : BOOLEAN ;
+ initGTh : BOOLEAN ;
(*
diff --git a/gcc/m2/gm2-libs-iso/ClientSocket.mod b/gcc/m2/gm2-libs-iso/ClientSocket.mod
index 15a194d..56145c3 100644
--- a/gcc/m2/gm2-libs-iso/ClientSocket.mod
+++ b/gcc/m2/gm2-libs-iso/ClientSocket.mod
@@ -28,7 +28,7 @@ IMPLEMENTATION MODULE ClientSocket ;
FROM ASCII IMPORT nul, lf, cr ;
-FROM ChanConsts IMPORT OpenResults, ChanFlags ;
+FROM ChanConsts IMPORT ChanFlags ;
FROM RTio IMPORT GetDeviceId ;
FROM RTgenif IMPORT GenDevIF, InitGenDevIF ;
FROM RTdata IMPORT ModuleId, MakeModuleId, InitData, GetData, KillData ;
diff --git a/gcc/m2/gm2-libs-iso/IOChan.mod b/gcc/m2/gm2-libs-iso/IOChan.mod
index 1376e06..83040c6 100644
--- a/gcc/m2/gm2-libs-iso/IOChan.mod
+++ b/gcc/m2/gm2-libs-iso/IOChan.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE IOChan ;
-IMPORT FIO, EXCEPTIONS, M2EXCEPTION, RTio, IOConsts,
+IMPORT FIO, EXCEPTIONS, M2EXCEPTION, RTio,
RTentity, errno, ErrnoCategory, IOLink, StdChans, M2RTS ;
FROM EXCEPTIONS IMPORT ExceptionSource, RAISE, AllocateSource,
diff --git a/gcc/m2/gm2-libs-iso/IOLink.mod b/gcc/m2/gm2-libs-iso/IOLink.mod
index 1e10f29..0ac9a44 100644
--- a/gcc/m2/gm2-libs-iso/IOLink.mod
+++ b/gcc/m2/gm2-libs-iso/IOLink.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE IOLink ;
-IMPORT RTio, RTentity, EXCEPTIONS, IOChan, M2RTS, SYSTEM, ASCII ;
+IMPORT RTio, RTentity, EXCEPTIONS, M2RTS, ASCII ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
diff --git a/gcc/m2/gm2-libs-iso/IOResult.mod b/gcc/m2/gm2-libs-iso/IOResult.mod
index 4b46cdc..d61a3cd 100644
--- a/gcc/m2/gm2-libs-iso/IOResult.mod
+++ b/gcc/m2/gm2-libs-iso/IOResult.mod
@@ -26,7 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE IOResult ;
-IMPORT IOChan ;
PROCEDURE ReadResult (cid: IOChan.ChanId): ReadResults;
(* Returns the result for the last read operation on the channel cid. *)
diff --git a/gcc/m2/gm2-libs-iso/LongIO.mod b/gcc/m2/gm2-libs-iso/LongIO.mod
index 40a2a60..06fecca 100644
--- a/gcc/m2/gm2-libs-iso/LongIO.mod
+++ b/gcc/m2/gm2-libs-iso/LongIO.mod
@@ -17,7 +17,7 @@ IMPLEMENTATION MODULE LongIO;
*)
FROM TextIO IMPORT WriteChar, ReadChar ;
-FROM StringChan IMPORT writeString ;
+FROM StringChan IMPORT writeString, writeFieldWidth ;
FROM IOChan IMPORT SetReadResult ;
FROM IOConsts IMPORT ReadResults ;
@@ -25,10 +25,8 @@ FROM ConvStringLong IMPORT RealToFixedString, RealToFloatString,
RealToEngString ;
FROM ConvTypes IMPORT ScanClass, ScanState ;
-FROM TextIO IMPORT WriteChar, ReadChar ;
FROM DynamicStrings IMPORT String, char, KillString, Length, InitString, ConCatChar, string ;
FROM LongConv IMPORT ScanReal ;
-FROM StringChan IMPORT writeString, writeFieldWidth ;
FROM ldtoa IMPORT strtold ;
FROM TextUtil IMPORT SkipSpaces ;
diff --git a/gcc/m2/gm2-libs-iso/LongWholeIO.mod b/gcc/m2/gm2-libs-iso/LongWholeIO.mod
index 666e109..01f410c 100644
--- a/gcc/m2/gm2-libs-iso/LongWholeIO.mod
+++ b/gcc/m2/gm2-libs-iso/LongWholeIO.mod
@@ -41,8 +41,6 @@ FROM TextUtil IMPORT SkipSpaces ;
type IOConsts.ReadResults.
*)
-IMPORT IOChan;
-
(* The text form of a signed whole number is
["+" | "-"], decimal digit, {decimal digit}
diff --git a/gcc/m2/gm2-libs-iso/M2RTS.mod b/gcc/m2/gm2-libs-iso/M2RTS.mod
index 42e5c32..3c81312 100644
--- a/gcc/m2/gm2-libs-iso/M2RTS.mod
+++ b/gcc/m2/gm2-libs-iso/M2RTS.mod
@@ -31,7 +31,7 @@ FROM libc IMPORT abort, exit, write, getenv, printf, strlen ;
(* FROM Builtins IMPORT strncmp, strcmp ; not available during bootstrap. *)
FROM NumberIO IMPORT CardToStr ;
FROM StrLib IMPORT StrCopy, StrLen, StrEqual ;
-FROM SYSTEM IMPORT ADDRESS, ADR ;
+FROM SYSTEM IMPORT ADR ;
FROM ASCII IMPORT nl, nul ;
FROM Storage IMPORT ALLOCATE ;
diff --git a/gcc/m2/gm2-libs-iso/MemStream.mod b/gcc/m2/gm2-libs-iso/MemStream.mod
index 38435de..573b8d3 100644
--- a/gcc/m2/gm2-libs-iso/MemStream.mod
+++ b/gcc/m2/gm2-libs-iso/MemStream.mod
@@ -45,7 +45,7 @@ FROM RTgenif IMPORT GenDevIF, InitGenDevIF ;
FROM FIO IMPORT File ;
FROM IOConsts IMPORT ReadResults ;
FROM ChanConsts IMPORT readFlag, writeFlag ;
-FROM SYSTEM IMPORT ADDRESS, ADR ;
+FROM SYSTEM IMPORT ADR ;
FROM ASCII IMPORT nl, nul ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE, REALLOCATE ;
FROM libc IMPORT printf ;
diff --git a/gcc/m2/gm2-libs-iso/RTdata.mod b/gcc/m2/gm2-libs-iso/RTdata.mod
index 1c03f97..82ecec8 100644
--- a/gcc/m2/gm2-libs-iso/RTdata.mod
+++ b/gcc/m2/gm2-libs-iso/RTdata.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE RTdata ;
-FROM IOLink IMPORT DeviceTablePtr, RAISEdevException ;
+FROM IOLink IMPORT RAISEdevException ;
FROM RTentity IMPORT Group, InitGroup, PutKey, IsIn, DelKey ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
diff --git a/gcc/m2/gm2-libs-iso/RTfio.mod b/gcc/m2/gm2-libs-iso/RTfio.mod
index 34ac00c..945ac3c 100644
--- a/gcc/m2/gm2-libs-iso/RTfio.mod
+++ b/gcc/m2/gm2-libs-iso/RTfio.mod
@@ -26,11 +26,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE RTfio ;
-FROM IOLink IMPORT DeviceTablePtr ;
FROM RTio IMPORT GetFile ;
FROM errno IMPORT geterrno ;
-FROM FIO IMPORT File, ReadChar, UnReadChar, WriteChar, ReadNBytes, WriteNBytes, IsActive,
+FROM FIO IMPORT File, ReadChar, UnReadChar, WriteChar, ReadNBytes,
+ WriteNBytes, IsActive,
WriteLine, EOF, WasEOLN, IsNoError ;
@@ -97,7 +97,7 @@ END dorbytes ;
(*
- dowbytes -
+ dowbytes -
*)
PROCEDURE dowbytes (g: GenDevIF; d: DeviceTablePtr;
diff --git a/gcc/m2/gm2-libs-iso/RTgen.mod b/gcc/m2/gm2-libs-iso/RTgen.mod
index edf640d..c4706c5 100644
--- a/gcc/m2/gm2-libs-iso/RTgen.mod
+++ b/gcc/m2/gm2-libs-iso/RTgen.mod
@@ -29,7 +29,7 @@ IMPLEMENTATION MODULE RTgen ;
FROM IOChan IMPORT ChanId, InvalidChan, ChanExceptions ;
-FROM IOLink IMPORT DeviceTablePtr, DeviceTablePtrValue,
+FROM IOLink IMPORT DeviceTablePtrValue,
RAISEdevException ;
IMPORT ChanConsts ;
@@ -37,10 +37,9 @@ IMPORT IOConsts ;
IMPORT ErrnoCategory ;
IMPORT RTgen ;
-FROM RTgenif IMPORT GenDevIF, getDID,
+FROM RTgenif IMPORT getDID,
doReadChar, doUnReadChar, doGetErrno,
- doRBytes, doWBytes,
- doWBytes, doWrLn,
+ doRBytes, doWBytes, doWrLn,
isEOF, isError, isEOLN ;
FROM ChanConsts IMPORT FlagSet, readFlag, writeFlag, rawFlag,
diff --git a/gcc/m2/gm2-libs-iso/RealIO.mod b/gcc/m2/gm2-libs-iso/RealIO.mod
index ec2cc5b..ab73065 100644
--- a/gcc/m2/gm2-libs-iso/RealIO.mod
+++ b/gcc/m2/gm2-libs-iso/RealIO.mod
@@ -17,7 +17,7 @@ IMPLEMENTATION MODULE RealIO;
*)
FROM TextIO IMPORT WriteChar, ReadChar ;
-FROM StringChan IMPORT writeString ;
+FROM StringChan IMPORT writeString, writeFieldWidth ;
FROM IOChan IMPORT SetReadResult ;
FROM IOConsts IMPORT ReadResults ;
@@ -25,10 +25,8 @@ FROM ConvStringReal IMPORT RealToFixedString, RealToFloatString,
RealToEngString ;
FROM ConvTypes IMPORT ScanClass, ScanState ;
-FROM TextIO IMPORT WriteChar, ReadChar ;
FROM DynamicStrings IMPORT String, char, KillString, Length, InitString, ConCatChar, string ;
FROM RealConv IMPORT ScanReal ;
-FROM StringChan IMPORT writeString, writeFieldWidth ;
FROM dtoa IMPORT strtod ;
FROM TextUtil IMPORT SkipSpaces ;
diff --git a/gcc/m2/gm2-libs-iso/RndFile.mod b/gcc/m2/gm2-libs-iso/RndFile.mod
index d4b0724..46cf638 100644
--- a/gcc/m2/gm2-libs-iso/RndFile.mod
+++ b/gcc/m2/gm2-libs-iso/RndFile.mod
@@ -51,7 +51,7 @@ FROM EXCEPTIONS IMPORT ExceptionNumber, RAISE,
AllocateSource, ExceptionSource, IsCurrentSource,
IsExceptionalExecution ;
-IMPORT FIO, SYSTEM, RTio, errno, ErrnoCategory ;
+IMPORT FIO, RTio, errno, ErrnoCategory ;
VAR
diff --git a/gcc/m2/gm2-libs-iso/SYSTEM.mod b/gcc/m2/gm2-libs-iso/SYSTEM.mod
index 2de3437..b4a943f 100644
--- a/gcc/m2/gm2-libs-iso/SYSTEM.mod
+++ b/gcc/m2/gm2-libs-iso/SYSTEM.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE SYSTEM ;
-FROM libc IMPORT memcpy, memcpy, memset ;
+FROM libc IMPORT memcpy, memset ;
CONST
BitsPerBitset = MAX(BITSET)+1 ;
diff --git a/gcc/m2/gm2-libs-iso/ShortWholeIO.mod b/gcc/m2/gm2-libs-iso/ShortWholeIO.mod
index 0c7286c..fcd8065 100644
--- a/gcc/m2/gm2-libs-iso/ShortWholeIO.mod
+++ b/gcc/m2/gm2-libs-iso/ShortWholeIO.mod
@@ -41,8 +41,6 @@ FROM TextUtil IMPORT SkipSpaces ;
type IOConsts.ReadResults.
*)
-IMPORT IOChan;
-
(* The text form of a signed whole number is
["+" | "-"], decimal digit, {decimal digit}
diff --git a/gcc/m2/gm2-libs-iso/TextIO.mod b/gcc/m2/gm2-libs-iso/TextIO.mod
index eab156d..940f5d9 100644
--- a/gcc/m2/gm2-libs-iso/TextIO.mod
+++ b/gcc/m2/gm2-libs-iso/TextIO.mod
@@ -27,7 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE TextIO ;
-IMPORT IOChan, IOConsts, CharClass, ASCII ;
+IMPORT IOConsts, CharClass, ASCII ;
FROM SYSTEM IMPORT ADR ;
FROM FIO IMPORT FlushOutErr ;
FROM libc IMPORT printf ;
diff --git a/gcc/m2/gm2-libs-iso/TextUtil.mod b/gcc/m2/gm2-libs-iso/TextUtil.mod
index 6f6c02e..44dbd1c 100644
--- a/gcc/m2/gm2-libs-iso/TextUtil.mod
+++ b/gcc/m2/gm2-libs-iso/TextUtil.mod
@@ -1,6 +1,6 @@
IMPLEMENTATION MODULE TextUtil ;
-IMPORT IOChan, CharClass, IOConsts ;
+IMPORT CharClass, IOConsts ;
(*
SkipSpaces - skips any spaces.
diff --git a/gcc/m2/gm2-libs-iso/WholeIO.mod b/gcc/m2/gm2-libs-iso/WholeIO.mod
index b8ed377..4e6b75e 100644
--- a/gcc/m2/gm2-libs-iso/WholeIO.mod
+++ b/gcc/m2/gm2-libs-iso/WholeIO.mod
@@ -41,7 +41,6 @@ FROM TextUtil IMPORT SkipSpaces ;
type IOConsts.ReadResults.
*)
-IMPORT IOChan ;
(* The text form of a signed whole number is
["+" | "-"], decimal digit, {decimal digit}
diff --git a/gcc/m2/gm2-libs-log/BitByteOps.mod b/gcc/m2/gm2-libs-log/BitByteOps.mod
index 318a2e3..746bb62 100644
--- a/gcc/m2/gm2-libs-log/BitByteOps.mod
+++ b/gcc/m2/gm2-libs-log/BitByteOps.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE BitByteOps ;
-FROM SYSTEM IMPORT BYTE, ADR, SHIFT, ROTATE, TSIZE, BITSET8, CARDINAL8 ;
+FROM SYSTEM IMPORT ADR, SHIFT, ROTATE, TSIZE, BITSET8, CARDINAL8 ;
(*
diff --git a/gcc/m2/gm2-libs-log/FileSystem.mod b/gcc/m2/gm2-libs-log/FileSystem.mod
index 9f08819..99612fa 100644
--- a/gcc/m2/gm2-libs-log/FileSystem.mod
+++ b/gcc/m2/gm2-libs-log/FileSystem.mod
@@ -28,9 +28,9 @@ IMPLEMENTATION MODULE FileSystem ;
FROM M2RTS IMPORT InstallTerminationProcedure ;
FROM Storage IMPORT ALLOCATE ;
-FROM SYSTEM IMPORT WORD, BYTE, ADDRESS, ADR ;
-IMPORT FIO, SFIO, libc, wrapc ;
-FROM DynamicStrings IMPORT String, InitString, ConCat, ConCatChar, KillString, string ;
+FROM SYSTEM IMPORT ADR ;
+IMPORT SFIO, libc, wrapc ;
+FROM DynamicStrings IMPORT InitString, ConCat, ConCatChar, KillString, string ;
FROM FormatStrings IMPORT Sprintf2 ;
CONST
diff --git a/gcc/m2/gm2-libs-log/InOut.mod b/gcc/m2/gm2-libs-log/InOut.mod
index 517aca2..669d679 100644
--- a/gcc/m2/gm2-libs-log/InOut.mod
+++ b/gcc/m2/gm2-libs-log/InOut.mod
@@ -29,7 +29,7 @@ IMPLEMENTATION MODULE InOut ;
IMPORT FIO, SFIO, Terminal ;
FROM FIO IMPORT File, StdIn, StdOut ;
-FROM DynamicStrings IMPORT String, InitString, Mark, KillString, ConCat,
+FROM DynamicStrings IMPORT InitString, Mark, KillString, ConCat,
RemoveWhitePrefix, char, ConCatChar, Length ;
FROM StringConvert IMPORT CardinalToString, stoc, stoi, ctos, itos ;
diff --git a/gcc/m2/gm2-libs-log/RealConversions.mod b/gcc/m2/gm2-libs-log/RealConversions.mod
index 02e0f92..4e662fa 100644
--- a/gcc/m2/gm2-libs-log/RealConversions.mod
+++ b/gcc/m2/gm2-libs-log/RealConversions.mod
@@ -33,7 +33,7 @@ FROM DynamicStrings IMPORT String, InitString, KillString, CopyOut, Length,
InitStringCharDB, MultDB, DupDB, SliceDB ;
FROM StringConvert IMPORT LongrealToString, StringToLongreal,
- StringToLongreal, StringToInteger, itos ;
+ StringToInteger, itos ;
FROM ASCII IMPORT nul ;
FROM Builtins IMPORT logl, log10l ;
diff --git a/gcc/m2/gm2-libs/FIO.mod b/gcc/m2/gm2-libs/FIO.mod
index b46d505..711ac47 100644
--- a/gcc/m2/gm2-libs/FIO.mod
+++ b/gcc/m2/gm2-libs/FIO.mod
@@ -36,7 +36,7 @@ IMPLEMENTATION MODULE FIO ;
provides a simple buffered file input/output library.
*)
-FROM SYSTEM IMPORT ADR, TSIZE, SIZE, WORD ;
+FROM SYSTEM IMPORT ADR, TSIZE, WORD ;
FROM ASCII IMPORT nl, nul, tab ;
FROM StrLib IMPORT StrLen, StrConCat, StrCopy ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
diff --git a/gcc/m2/gm2-libs/FormatStrings.mod b/gcc/m2/gm2-libs/FormatStrings.mod
index 9c3a562..a5ab3b2 100644
--- a/gcc/m2/gm2-libs/FormatStrings.mod
+++ b/gcc/m2/gm2-libs/FormatStrings.mod
@@ -26,13 +26,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE FormatStrings ;
-FROM DynamicStrings IMPORT String, InitString, InitStringChar, Mark,
+FROM DynamicStrings IMPORT InitString, InitStringChar, Mark,
ConCat, Slice, Index, char, string,
Assign, Length, Mult, Dup, ConCatChar,
PushAllocation, PopAllocationExemption,
InitStringDB, InitStringCharStarDB,
InitStringCharDB, MultDB, DupDB, SliceDB,
- KillString, ConCatChar ;
+ KillString ;
FROM StringConvert IMPORT IntegerToString, CardinalToString, hstoc ;
FROM SYSTEM IMPORT ADDRESS ;
diff --git a/gcc/m2/gm2-libs/IO.mod b/gcc/m2/gm2-libs/IO.mod
index bd6d539..3c74f28 100644
--- a/gcc/m2/gm2-libs/IO.mod
+++ b/gcc/m2/gm2-libs/IO.mod
@@ -28,7 +28,7 @@ IMPLEMENTATION MODULE IO ;
FROM StrLib IMPORT StrCopy ;
-FROM SYSTEM IMPORT ADR, SIZE ;
+FROM SYSTEM IMPORT ADR ;
FROM libc IMPORT read, write, system, isatty ;
FROM FIO IMPORT File, StdIn, StdOut, StdErr, WriteChar, ReadChar,
diff --git a/gcc/m2/gm2-libs/Indexing.mod b/gcc/m2/gm2-libs/Indexing.mod
index 65c293c..f23778c 100644
--- a/gcc/m2/gm2-libs/Indexing.mod
+++ b/gcc/m2/gm2-libs/Indexing.mod
@@ -28,7 +28,7 @@ IMPLEMENTATION MODULE Indexing ;
FROM libc IMPORT memset, memmove ;
FROM Storage IMPORT ALLOCATE, REALLOCATE, DEALLOCATE ;
-FROM SYSTEM IMPORT TSIZE, ADDRESS, WORD, BYTE ;
+FROM SYSTEM IMPORT TSIZE, WORD, BYTE ;
CONST
MinSize = 128 ;
diff --git a/gcc/m2/gm2-libs/M2Dependent.mod b/gcc/m2/gm2-libs/M2Dependent.mod
index 19bdab1..f8a116c 100644
--- a/gcc/m2/gm2-libs/M2Dependent.mod
+++ b/gcc/m2/gm2-libs/M2Dependent.mod
@@ -29,7 +29,7 @@ IMPLEMENTATION MODULE M2Dependent ;
FROM libc IMPORT abort, exit, write, getenv, printf, snprintf, strncpy ;
FROM ASCII IMPORT nul, nl ;
-FROM SYSTEM IMPORT ADR, SIZE ;
+FROM SYSTEM IMPORT ADR ;
FROM Storage IMPORT ALLOCATE ;
FROM StrLib IMPORT StrCopy, StrLen, StrEqual ;
diff --git a/gcc/m2/gm2-libs/M2RTS.mod b/gcc/m2/gm2-libs/M2RTS.mod
index dec1d5f..5cc8709 100644
--- a/gcc/m2/gm2-libs/M2RTS.mod
+++ b/gcc/m2/gm2-libs/M2RTS.mod
@@ -31,7 +31,7 @@ FROM libc IMPORT abort, exit, write, getenv, printf, strlen ;
(* FROM Builtins IMPORT strncmp, strcmp ; not available during bootstrap. *)
FROM NumberIO IMPORT CardToStr ;
FROM StrLib IMPORT StrCopy, StrLen, StrEqual ;
-FROM SYSTEM IMPORT ADDRESS, ADR ;
+FROM SYSTEM IMPORT ADR ;
FROM ASCII IMPORT nl, nul ;
FROM Storage IMPORT ALLOCATE ;
diff --git a/gcc/m2/gm2-libs/OptLib.mod b/gcc/m2/gm2-libs/OptLib.mod
index 873ab6e..e4870ee 100644
--- a/gcc/m2/gm2-libs/OptLib.mod
+++ b/gcc/m2/gm2-libs/OptLib.mod
@@ -28,7 +28,6 @@ IMPLEMENTATION MODULE OptLib ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
FROM libc IMPORT memcpy ;
-FROM DynamicStrings IMPORT String ;
IMPORT DynamicStrings ;
diff --git a/gcc/m2/gm2-libs/SYSTEM.mod b/gcc/m2/gm2-libs/SYSTEM.mod
index 8d2a005..8337105 100644
--- a/gcc/m2/gm2-libs/SYSTEM.mod
+++ b/gcc/m2/gm2-libs/SYSTEM.mod
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
IMPLEMENTATION MODULE SYSTEM ;
-FROM libc IMPORT memcpy, memcpy, memset ;
+FROM libc IMPORT memcpy, memset ;
CONST
BitsPerBitset = MAX(BITSET)+1 ;
diff --git a/gcc/m2/gm2-libs/StringConvert.mod b/gcc/m2/gm2-libs/StringConvert.mod
index e2208ca..c1c8c39 100644
--- a/gcc/m2/gm2-libs/StringConvert.mod
+++ b/gcc/m2/gm2-libs/StringConvert.mod
@@ -33,7 +33,7 @@ FROM M2RTS IMPORT ErrorMessage ;
IMPORT DynamicStrings ;
-FROM DynamicStrings IMPORT String, InitString,
+FROM DynamicStrings IMPORT InitString,
InitStringChar, InitStringCharStar,
Mark, ConCat, Dup, string,
Slice, Index, char, Assign, Length, Mult,
diff --git a/gcc/testsuite/gm2/switches/pedantic/pass/hello.mod b/gcc/testsuite/gm2/switches/pedantic/pass/hello.mod
new file mode 100644
index 0000000..74a15e5
--- /dev/null
+++ b/gcc/testsuite/gm2/switches/pedantic/pass/hello.mod
@@ -0,0 +1,8 @@
+MODULE hello;
+
+FROM STextIO IMPORT WriteString, WriteLn ;
+
+BEGIN
+ WriteString ("Hello world") ;
+ WriteLn
+END hello.
diff --git a/gcc/testsuite/gm2/switches/pedantic/pass/switches-pedantic-pass.exp b/gcc/testsuite/gm2/switches/pedantic/pass/switches-pedantic-pass.exp
new file mode 100644
index 0000000..ce5fd36
--- /dev/null
+++ b/gcc/testsuite/gm2/switches/pedantic/pass/switches-pedantic-pass.exp
@@ -0,0 +1,38 @@
+# Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This file was written by Gaius Mulley (gaius.mulley@southwales.ac.uk)
+# for GNU Modula-2.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# load support procs
+load_lib gm2-torture.exp
+
+set gm2src ${srcdir}/../m2
+
+gm2_init_iso "${srcdir}/gm2/switches/pedantic/pass" -Wpedantic -Werror
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+
+ gm2-torture-execute $testcase "" "pass"
+}
diff --git a/libgm2/libm2iso/Makefile.am b/libgm2/libm2iso/Makefile.am
index ddd2462..8e774c5 100644
--- a/libgm2/libm2iso/Makefile.am
+++ b/libgm2/libm2iso/Makefile.am
@@ -196,7 +196,8 @@ libm2iso_la_CFLAGS = \
libm2iso_la_M2FLAGS = \
-fm2-pathname=m2iso -I. -Ilibm2iso -I$(GM2_SRC)/gm2-libs-iso \
-fm2-pathname=m2pim -I$(GM2_SRC)/gm2-libs \
- -fiso -fextended-opaque -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2iso \
+ -fiso -fextended-opaque -fm2-g -g -Wcase-enum \
+ -Wreturn-type -fcase -fm2-prefix=m2iso \
$(TARGET_LONGDOUBLE_ABI)
if TARGET_DARWIN
libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup
diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in
index 97de40c..a82aa0c 100644
--- a/libgm2/libm2iso/Makefile.in
+++ b/libgm2/libm2iso/Makefile.in
@@ -583,7 +583,8 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_ISOLIB_TRUE@libm2iso_la_M2FLAGS = \
@BUILD_ISOLIB_TRUE@ -fm2-pathname=m2iso -I. -Ilibm2iso -I$(GM2_SRC)/gm2-libs-iso \
@BUILD_ISOLIB_TRUE@ -fm2-pathname=m2pim -I$(GM2_SRC)/gm2-libs \
-@BUILD_ISOLIB_TRUE@ -fiso -fextended-opaque -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2iso \
+@BUILD_ISOLIB_TRUE@ -fiso -fextended-opaque -fm2-g -g -Wcase-enum \
+@BUILD_ISOLIB_TRUE@ -Wreturn-type -fcase -fm2-prefix=m2iso \
@BUILD_ISOLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI)
@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@libm2iso_la_link_flags = \
diff --git a/libgm2/libm2log/Makefile.am b/libgm2/libm2log/Makefile.am
index 9571d50..8dadaae 100644
--- a/libgm2/libm2log/Makefile.am
+++ b/libgm2/libm2log/Makefile.am
@@ -137,7 +137,8 @@ libm2log_la_M2FLAGS = \
-fm2-pathname=m2log -I$(GM2_SRC)/gm2-libs-log \
-fm2-pathname=m2pim -I$(GM2_SRC)/gm2-libs \
-fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
- -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2log \
+ -Wcase-enum -Wreturn-type \
+ -fcase -fm2-prefix=m2log \
$(TARGET_LONGDOUBLE_ABI)
if TARGET_DARWIN
libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup
diff --git a/libgm2/libm2log/Makefile.in b/libgm2/libm2log/Makefile.in
index bc64692..4c37135 100644
--- a/libgm2/libm2log/Makefile.in
+++ b/libgm2/libm2log/Makefile.in
@@ -486,7 +486,8 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_LOGLIB_TRUE@ -fm2-pathname=m2log -I$(GM2_SRC)/gm2-libs-log \
@BUILD_LOGLIB_TRUE@ -fm2-pathname=m2pim -I$(GM2_SRC)/gm2-libs \
@BUILD_LOGLIB_TRUE@ -fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
-@BUILD_LOGLIB_TRUE@ -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2log \
+@BUILD_LOGLIB_TRUE@ -Wcase-enum -Wreturn-type \
+@BUILD_LOGLIB_TRUE@ -fcase -fm2-prefix=m2log \
@BUILD_LOGLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI)
@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@libm2log_la_link_flags = \
diff --git a/libgm2/libm2pim/Makefile.am b/libgm2/libm2pim/Makefile.am
index dd1fd08..4c5e046 100644
--- a/libgm2/libm2pim/Makefile.am
+++ b/libgm2/libm2pim/Makefile.am
@@ -173,7 +173,8 @@ libm2pim_la_CFLAGS = \
libm2pim_la_M2FLAGS = \
-fm2-pathname=m2pim -I. -I$(GM2_SRC)/gm2-libs \
-fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
- -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2pim \
+ -fm2-g -g -Wcase-enum -Wreturn-type \
+ -fcase -fm2-prefix=m2pim \
$(TARGET_LONGDOUBLE_ABI)
if TARGET_DARWIN
libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup
diff --git a/libgm2/libm2pim/Makefile.in b/libgm2/libm2pim/Makefile.in
index c9817bc..eca7e85 100644
--- a/libgm2/libm2pim/Makefile.in
+++ b/libgm2/libm2pim/Makefile.in
@@ -551,7 +551,8 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_PIMLIB_TRUE@libm2pim_la_M2FLAGS = \
@BUILD_PIMLIB_TRUE@ -fm2-pathname=m2pim -I. -I$(GM2_SRC)/gm2-libs \
@BUILD_PIMLIB_TRUE@ -fm2-pathname=m2iso -I$(GM2_SRC)/gm2-libs-iso \
-@BUILD_PIMLIB_TRUE@ -fm2-g -g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2pim \
+@BUILD_PIMLIB_TRUE@ -fm2-g -g -Wcase-enum -Wreturn-type \
+@BUILD_PIMLIB_TRUE@ -fcase -fm2-prefix=m2pim \
@BUILD_PIMLIB_TRUE@ $(TARGET_LONGDOUBLE_ABI)
@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@libm2pim_la_link_flags = \