[m-rev.] for review: don't make asm label functions static

Ian MacLarty maclarty at csse.unimelb.edu.au
Tue Jul 6 12:17:33 AEST 2010


For review by anyone.

I've bootchecked this change in asm_fast.gc.

runtime/mercury_goto.h:
    Don't make declarations for label functions that are implemented as
    assembler static, because that causes GCC 4.x to issue a warning that the
    function is used but not defined.

Index: runtime/mercury_goto.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_goto.h,v
retrieving revision 1.54
diff -u -r1.54 mercury_goto.h
--- runtime/mercury_goto.h	4 Dec 2009 02:39:47 -0000	1.54
+++ runtime/mercury_goto.h	6 Jul 2010 02:09:01 -0000
@@ -876,8 +876,12 @@
   #if defined(MR_USE_ASM_LABELS)
     #define MR_declare_entry(label)					\
 	extern void label(void) __asm__("_entry_" MR_STRINGIFY(label))
+    /* When using asm labels, we don't create a static declaration, */
+    /* because the lack of a C implementation for the function will */
+    /* cause GCC 4.x to issue warnings about the function being used */
+    /* and not defined. */
     #define MR_declare_static(label)					\
-	static void label(void) __asm__("_entry_" MR_STRINGIFY(label))
+	MR_declare_entry(label)
     #define MR_define_extern_entry(label)	MR_declare_entry(label)
     #define MR_define_entry(label)					\
 		MR_ASM_ENTRY(label)					\
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list