]> gcc.gnu.org Git - gcc.git/commitdiff
PR modula2/112984 Compiling program with -Wpedantic shows warning in libraries
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 12 Dec 2023 19:29:06 +0000 (19:29 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 12 Dec 2023 19:29:06 +0000 (19:29 +0000)
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>
40 files changed:
gcc/m2/gm2-libs-coroutines/SYSTEM.mod
gcc/m2/gm2-libs-iso/ClientSocket.mod
gcc/m2/gm2-libs-iso/IOChan.mod
gcc/m2/gm2-libs-iso/IOLink.mod
gcc/m2/gm2-libs-iso/IOResult.mod
gcc/m2/gm2-libs-iso/LongIO.mod
gcc/m2/gm2-libs-iso/LongWholeIO.mod
gcc/m2/gm2-libs-iso/M2RTS.mod
gcc/m2/gm2-libs-iso/MemStream.mod
gcc/m2/gm2-libs-iso/RTdata.mod
gcc/m2/gm2-libs-iso/RTfio.mod
gcc/m2/gm2-libs-iso/RTgen.mod
gcc/m2/gm2-libs-iso/RealIO.mod
gcc/m2/gm2-libs-iso/RndFile.mod
gcc/m2/gm2-libs-iso/SYSTEM.mod
gcc/m2/gm2-libs-iso/ShortWholeIO.mod
gcc/m2/gm2-libs-iso/TextIO.mod
gcc/m2/gm2-libs-iso/TextUtil.mod
gcc/m2/gm2-libs-iso/WholeIO.mod
gcc/m2/gm2-libs-log/BitByteOps.mod
gcc/m2/gm2-libs-log/FileSystem.mod
gcc/m2/gm2-libs-log/InOut.mod
gcc/m2/gm2-libs-log/RealConversions.mod
gcc/m2/gm2-libs/FIO.mod
gcc/m2/gm2-libs/FormatStrings.mod
gcc/m2/gm2-libs/IO.mod
gcc/m2/gm2-libs/Indexing.mod
gcc/m2/gm2-libs/M2Dependent.mod
gcc/m2/gm2-libs/M2RTS.mod
gcc/m2/gm2-libs/OptLib.mod
gcc/m2/gm2-libs/SYSTEM.mod
gcc/m2/gm2-libs/StringConvert.mod
gcc/testsuite/gm2/switches/pedantic/pass/hello.mod [new file with mode: 0644]
gcc/testsuite/gm2/switches/pedantic/pass/switches-pedantic-pass.exp [new file with mode: 0644]
libgm2/libm2iso/Makefile.am
libgm2/libm2iso/Makefile.in
libgm2/libm2log/Makefile.am
libgm2/libm2log/Makefile.in
libgm2/libm2pim/Makefile.am
libgm2/libm2pim/Makefile.in

index 3652dec78f16329c1e46d37c433227935d8df541..f8ec6d725a18def65906275e59b88827ef9c5bbb 100644 (file)
@@ -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 ;
 
 
 (*
index 15a194da587ca86182cdfac7ad35414c1fe097d9..56145c3b5e235a018716e0ba42f213a17f8deb3f 100644 (file)
@@ -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 ;
index 1376e067d94e59fa8d02eb4f6630079125310eea..83040c6fddf00e0557bae5fac8b2c4392324e2c8 100644 (file)
@@ -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,
index 1e10f29e7e04e511b7f6f17916ddee6c2b8a867b..0ac9a44532595d1c76fbbb1df47d1c4b9775b2bb 100644 (file)
@@ -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 ;
 
index 4b46cdcb1ead5e564a3ba14209ee43ffeb19d33a..d61a3cdbfaa624e60d4720ebbf93b08864c9e9fb 100644 (file)
@@ -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. *)
index 40a2a601b63d17fc6d6040ee3b41d1ea5b3cc013..06feccaaed2cd1b84153fd573b7929216bc5fb3e 100644 (file)
@@ -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 ;
 
index 666e109fabc132a15309394932f5a01126d5e058..01f410c88a1526d565236c718590d8ec121c7f76 100644 (file)
@@ -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}
 
index 42e5c328fc26ed68d0bc6d5c508370c3353ad4b8..3c813123a6392fd4d70d816a7d660785c7260dc6 100644 (file)
@@ -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 ;
 
index 38435de254422deb914bdd3c2c023fa1095436b5..573b8d32ff998373101db4e5cde23812197b91e6 100644 (file)
@@ -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 ;
index 1c03f973655e9348920c46091a79b5cb2ad3a6b0..82ecec87675c76d37863cffd006c4f956c0a78f0 100644 (file)
@@ -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 ;
 
index 34ac00cb28fde02f1ffcbcee0249e35733b0155c..945ac3cad3361ab2af324d63b1937baaef16c940 100644 (file)
@@ -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;
index edf640d0dc55fdd2cd8de833d081287ef08841ac..c4706c58a387b32969912544958387a9abe41eaf 100644 (file)
@@ -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,
index ec2cc5b5fe52effd23320b7101443add54f8a431..ab73065efadcfcc6495ad1a789bcc37d227c2883 100644 (file)
@@ -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 ;
 
index d4b072452bda792f7dc1ed15cc73b3f19d83ad10..46cf6389ebf9ff445e9c83bda86c24f9428e569c 100644 (file)
@@ -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
index 2de3437a855a4aeb81399f275f584775bffc224b..b4a943f3776e78d47a6832aa7ab8643353262f2e 100644 (file)
@@ -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 ;
index 0c7286c3162d370aff905ad1e476cf126f49e0b2..fcd806568bc4fc5b69e613caafb68f7e379dfb0c 100644 (file)
@@ -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}
 
index eab156d207621b81035a221d0e441908f940ed40..940f5d97217f7c94a838c880ce74911ef0f9a4dd 100644 (file)
@@ -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 ;
index 6f6c02e68b12eea036f9e51e82245bcff59324fa..44dbd1c69f8b9bead426fdcb03449b1cbc97d9aa 100644 (file)
@@ -1,6 +1,6 @@
 IMPLEMENTATION MODULE TextUtil ;
 
-IMPORT IOChan, CharClass, IOConsts ;
+IMPORT CharClass, IOConsts ;
 
 (*
    SkipSpaces - skips any spaces.
index b8ed377973954521026b463e8fc295c4397f1993..4e6b75e7171cc5d5f4c0c7a3c900f3a2abd4aab2 100644 (file)
@@ -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}
index 318a2e3b53d3d082ffe3df250c02dde6a668f674..746bb62de3fcefe9aa6dc79443cf17b4165feab3 100644 (file)
@@ -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 ;
 
 
 (*
index 9f08819d58666fa03e7e99db9c37121a2bad1603..99612fac3f6aba767246a939a205aa1baa9f6e51 100644 (file)
@@ -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
index 517aca2c7b43c59c577224ad75d69c24602d0909..669d67970031f8852c103cd746fe84307be72a5d 100644 (file)
@@ -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 ;
index 02e0f9241d5d489ec7bb8b3933da86f1219a474f..4e662fa01e2ad8da6587496b8cd55d4c33d73557 100644 (file)
@@ -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 ;
index b46d505d30c91d01f569fd64b29423d8edd00422..711ac47649bde1a9a7e1807a6ab94cc35d7ce6db 100644 (file)
@@ -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 ;
index 9c3a56228f94ba9664b29efdd3d576af20bbceeb..a5ab3b29f615fa81f449d06f5ed0e0ba5ce147d4 100644 (file)
@@ -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 ;
index bd6d539634a05e8bd09a9e49ef6ba1bb01c99e73..3c74f288c8003e8551d9ad5a2e9dc411f707a14b 100644 (file)
@@ -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,
index 65c293cf26db17be8bdbe22b77c8af14b421e452..f23778c644ee2676a35596306b19da38e71b5f22 100644 (file)
@@ -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 ;
index 19bdab1bc508340aef05943010cf6d02707922ee..f8a116cb19ce53eaba00c5248aa364d665a40e9f 100644 (file)
@@ -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 ;
 
index dec1d5f0c29b3c75a920935e5354fd49e05efc4f..5cc87094457a601caac0b528b33192b73f8edf0e 100644 (file)
@@ -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 ;
 
index 873ab6e4ffbce17c6f8881273b1684b83fe5a8cb..e4870eefebaa1327ebccb20568f1b3063340b2b3 100644 (file)
@@ -28,7 +28,6 @@ IMPLEMENTATION MODULE OptLib ;
 
 FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
 FROM libc IMPORT memcpy ;
-FROM DynamicStrings IMPORT String ;
 
 IMPORT DynamicStrings ;
 
index 8d2a00583ce8f643995a9375b398cf057fd9f7f4..8337105029a309424e819a8bb0d79c41c94b35db 100644 (file)
@@ -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 ;
index e2208ca6ad031bc1a47e0f4c5a6316b7a975e2c5..c1c8c395c16f01073b366c0e3d9beb239b04be8f 100644 (file)
@@ -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 (file)
index 0000000..74a15e5
--- /dev/null
@@ -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 (file)
index 0000000..ce5fd36
--- /dev/null
@@ -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"
+}
index ddd24629849f40e05efdfb8fd4f4564a55551413..8e774c5ea19552eb22e7d160f2d1492691f6219b 100644 (file)
@@ -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
index 97de40c034b8aee8e6b6af4c1b473ae71633c459..a82aa0c408bce96152dd0e32f056f97502d5d2d8 100644 (file)
@@ -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 =  \
index 9571d50585c4f1e498851fdf1049887b28fe6ace..8dadaae95388932e5374cccca2ff599c9f73604f 100644 (file)
@@ -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
index bc64692c0fa8758c81c4c9b1bc670eee908126dd..4c371350ce2fb78702ec8f08b55dc9eb5482c5bb 100644 (file)
@@ -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 =  \
index dd1fd08e90e0b817040fac83f906a158fd4256c1..4c5e046a1c98141d264b6f0721b0ba5e6eb62c2c 100644 (file)
@@ -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
index c9817bc4746d9ca64ef11afd26a2a0a0f8ad2041..eca7e8501adb466a6ef3e59d37dbe731cec96f58 100644 (file)
@@ -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 =  \
This page took 0.106344 seconds and 5 git commands to generate.