public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries
@ 2023-12-12 10:44 gaius at gcc dot gnu.org
2023-12-12 10:44 ` [Bug modula2/112984] " gaius at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-12 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112984
Bug ID: 112984
Summary: Compiling program with -Wpedantic shows warning in
libraries
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: gaius at gcc dot gnu.org
Target Milestone: ---
Forwarded from the gm2 mailing list:
Consider the hello world program below:
MODULE test_hello;
FROM STextIO IMPORT WriteString, WriteLn;
BEGIN
WriteLn;
WriteString("Hello, World!");
WriteLn;
WriteLn;
END test_hello.
if compiled with -Wpedantic
gm2 -fiso -fsoft-check-all -Wpedantic test_hello.mod
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/SYSTEM.mod:31:1:
error: In implementation module ‘SYSTEM’: symbol (memcpy) has already been
imported
31 | CONST
| ^~~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/M2RTS.mod:35:1:
error: In implementation module ‘M2RTS’: symbol (ADDRESS) has already been
imported
35 | FROM ASCII IMPORT nl, nul ;
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/TextIO.mod:31:1:
error: In implementation module ‘TextIO’: symbol (IOChan) has already been
imported
31 | FROM SYSTEM IMPORT ADR ;
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/IOChan.mod:32:1:
error: In implementation module ‘IOChan’: symbol (IOConsts) has already been
imported
32 | FROM EXCEPTIONS IMPORT ExceptionSource, RAISE, AllocateSource,
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/IOLink.mod:31:1:
error: In implementation module ‘IOLink’: symbol (SYSTEM) has already been
imported
31 | FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/IOLink.mod:31:1:
error: symbol (IOChan) has already been imported
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/RTfio.mod:30:1:
error: In implementation module ‘RTfio’: symbol (DeviceTablePtr) has already
been imported
30 | FROM RTio IMPORT GetFile ;
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/RTgen.mod:35:1:
error: In implementation module ‘RTgen’: symbol (DeviceTablePtr) has already
been imported
35 | IMPORT ChanConsts ;
| ^~~~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/RTgen.mod:46:1:
error: symbol (doWBytes) has already been imported
46 | FROM ChanConsts IMPORT FlagSet, readFlag, writeFlag, rawFlag,
| ^~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/RTgen.mod:46:1:
error: symbol (GenDevIF) has already been imported
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2iso/TextUtil.mod:9:1:
error: In implementation module ‘TextUtil’: symbol (IOChan) has already been
imported
9 | PROCEDURE SkipSpaces (cid: IOChan.ChanId) ;
| ^~~~~~~~~
/home/gaius/opt/lib/gcc/x86_64-pc-linux-gnu/14.0.0/m2/m2pim/Indexing.mod:33:1:
error: In implementation module ‘Indexing’: symbol (ADDRESS) has already been
imported
33 | CONST
shows many warnings in the libraries (and it looks as if an error should be a
warning possibly).
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug modula2/112984] Compiling program with -Wpedantic shows warning in libraries
2023-12-12 10:44 [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries gaius at gcc dot gnu.org
@ 2023-12-12 10:44 ` gaius at gcc dot gnu.org
2023-12-12 16:18 ` gaius at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-12 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112984
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2023-12-12
--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Confirmed in gcc-14 will fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug modula2/112984] Compiling program with -Wpedantic shows warning in libraries
2023-12-12 10:44 [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries gaius at gcc dot gnu.org
2023-12-12 10:44 ` [Bug modula2/112984] " gaius at gcc dot gnu.org
@ 2023-12-12 16:18 ` gaius at gcc dot gnu.org
2023-12-12 19:29 ` cvs-commit at gcc dot gnu.org
2023-12-12 19:33 ` gaius at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-12 16:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112984
--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 56865
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56865&action=edit
Proposed fix
Here is a proposed fix - all libraries can be compiled with -Wpedantic (apart
from two which have necessary infinite loops). Perhaps the -Wpedantic needs to
be turned off via an attribute in these two modules (one of which is the
procedure SYSTEM.Listen which waits for activity in a set of fds).
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug modula2/112984] Compiling program with -Wpedantic shows warning in libraries
2023-12-12 10:44 [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries gaius at gcc dot gnu.org
2023-12-12 10:44 ` [Bug modula2/112984] " gaius at gcc dot gnu.org
2023-12-12 16:18 ` gaius at gcc dot gnu.org
@ 2023-12-12 19:29 ` cvs-commit at gcc dot gnu.org
2023-12-12 19:33 ` gaius at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-12 19:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112984
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:01cca857aa3e86a750f5df77ca6c36c0739f10f0
commit r14-6465-g01cca857aa3e86a750f5df77ca6c36c0739f10f0
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Tue Dec 12 19:29:06 2023 +0000
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug modula2/112984] Compiling program with -Wpedantic shows warning in libraries
2023-12-12 10:44 [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries gaius at gcc dot gnu.org
` (2 preceding siblings ...)
2023-12-12 19:29 ` cvs-commit at gcc dot gnu.org
@ 2023-12-12 19:33 ` gaius at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-12 19:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112984
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now that the patch has been applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-12-12 19:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 10:44 [Bug modula2/112984] New: Compiling program with -Wpedantic shows warning in libraries gaius at gcc dot gnu.org
2023-12-12 10:44 ` [Bug modula2/112984] " gaius at gcc dot gnu.org
2023-12-12 16:18 ` gaius at gcc dot gnu.org
2023-12-12 19:29 ` cvs-commit at gcc dot gnu.org
2023-12-12 19:33 ` gaius at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).