]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compilation warnings in pdumper with !HAVE_NATIVECOMP
authorStefan Kangas <stefankangas@gmail.com>
Sun, 26 Jan 2025 20:17:31 +0000 (21:17 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:02:40 +0000 (19:02 +0100)
* src/pdumper.c [!HAVE_NATIVECOMP] (cold_op, dump_subr): Fix
compilation warnings.
Ref: https://lists.gnu.org/r/emacs-devel/2025-01/msg01003.html

(cherry picked from commit aec9e66178793e631f0583768315a6371054c907)

src/pdumper.c

index 77d4407935e763ac853718bc3ee3009e3c53f83d..45a44db0243f00b8dc73cd59cea3384120c24db0 100644 (file)
@@ -446,7 +446,9 @@ enum cold_op
     COLD_OP_CHARSET,
     COLD_OP_BUFFER,
     COLD_OP_BIGNUM,
+#ifdef HAVE_NATIVE_COMP
     COLD_OP_NATIVE_SUBR,
+#endif
   };
 
 /* This structure controls what operations we perform inside
@@ -2972,15 +2974,14 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
   DUMP_FIELD_COPY (&out, subr, header.size);
 #ifdef HAVE_NATIVE_COMP
   bool non_primitive = !NILP (subr->native_comp_u);
-#else
-  bool non_primitive = false;
-#endif
   if (non_primitive)
     out.function.a0 = NULL;
   else
+#endif
     dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0);
   DUMP_FIELD_COPY (&out, subr, min_args);
   DUMP_FIELD_COPY (&out, subr, max_args);
+#ifdef HAVE_NATIVE_COMP
   if (non_primitive)
     {
       dump_field_fixup_later (ctx, &out, subr, &subr->symbol_name);
@@ -2991,6 +2992,7 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
       dump_field_lv (ctx, &out, subr, &subr->command_modes, WEIGHT_NORMAL);
     }
   else
+#endif
     {
       dump_field_emacs_ptr (ctx, &out, subr, &subr->symbol_name);
       dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec.string);
@@ -3006,12 +3008,14 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
   dump_field_lv (ctx, &out, subr, &subr->type, WEIGHT_NORMAL);
 #endif
   dump_off subr_off = dump_object_finish (ctx, &out, sizeof (out));
+#ifdef HAVE_NATIVE_COMP
   if (non_primitive && ctx->flags.dump_object_contents)
     /* We'll do the final addr relocation during VERY_LATE_RELOCS time
        after the compilation units has been loaded. */
     dump_push (&ctx->dump_relocs[VERY_LATE_RELOCS],
               list2 (make_fixnum (RELOC_NATIVE_SUBR),
                      dump_off_to_lisp (subr_off)));
+#endif
   return subr_off;
 }