modula2: Add noreturn attribute to m2/gm2-libs/M2RTS.mod

This patch removes a build warning by adding a noreturn attribute
to the M2RTS.mod:HaltC procedure.  Also add an infinite loop to
gm2-libs-min/M2RTS.mod.

gcc/m2/ChangeLog:

	* Make-lang.in (m2/gm2-libs-boot/M2RTS.o): Remove
	--suppress-noreturn.
	* gm2-libs/M2RTS.mod (HaltC): Add noreturn attribute.
	* gm2-libs-min/M2RTS.mod (HALT): Add LOOP END.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
This commit is contained in:
Gaius Mulley 2024-09-24 00:28:19 +01:00
parent 0121b852c8
commit 5ef52ec422
3 changed files with 4 additions and 2 deletions

View File

@ -1477,7 +1477,7 @@ mcflex.c: $(srcdir)/m2/mc/mc.flex
m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-H)
-test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
$(MC) --suppress-noreturn -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod
$(MC) -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod
$(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -I$(srcdir)/m2/gm2-libs-ch $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/M2RTS.c -o $@
$(POSTCOMPILE)

View File

@ -69,6 +69,8 @@ END ExecuteInitialProcedures ;
PROCEDURE HALT ;
BEGIN
LOOP
END
END HALT ;

View File

@ -286,7 +286,7 @@ END ErrorMessageC ;
to stderr and calls exit (1).
*)
PROCEDURE HaltC (description, filename, function: ADDRESS; line: CARDINAL) ;
PROCEDURE HaltC (description, filename, function: ADDRESS; line: CARDINAL) <* noreturn *> ;
BEGIN
ErrorMessageC (description, filename, line, function)
END HaltC ;