]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH] modula2: Add noreturn attribute to m2/gm2-libs/M2RTS.mod
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 2 Dec 2024 18:03:31 +0000 (18:03 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 2 Dec 2024 18:03:31 +0000 (18:03 +0000)
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.

(cherry picked from commit 5ef52ec422b8b92539baaa761ad878ccb6f82db8)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/Make-lang.in
gcc/m2/gm2-libs-min/M2RTS.mod
gcc/m2/gm2-libs/M2RTS.mod

index 02754e98c572a79d3b03a3000c429313ec30f159..480c4fb28a7e619f50ea240270834f567431df0b 100644 (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)
 
index ae8cbfffbec9c2526362e7ae7ed344127daf88a5..1f04a027f82c305a6260a68f9fdeb377fd577cb6 100644 (file)
@@ -69,6 +69,8 @@ END ExecuteInitialProcedures ;
 
 PROCEDURE HALT ;
 BEGIN
+   LOOP
+   END
 END HALT ;
 
 
index cb3c26f7ce11778cc7e08f2bcfa84b90aa184bf6..98726a8d737e222f1a9bb65695a80f39e49fb829 100644 (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) ;
    exit (1)