]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
create_inode: fix 32-bit -Werror=pointer-to-int-cast build failure
authorTheodore Ts'o <tytso@mit.edu>
Mon, 26 May 2025 20:46:45 +0000 (16:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 May 2025 20:46:45 +0000 (16:46 -0400)
Fixes: 6bfa843b4435 ("mke2fs: enable copying of fs-verity metadata")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
configure
configure.ac
lib/config.h.in
misc/create_inode.c

index 4b3a4df7f1f6baa9f343a2fb1aff7f6172b7b376..0ac202d8272d5b0639a3e6aee7dd8215bef5da41 100755 (executable)
--- a/configure
+++ b/configure
@@ -12765,6 +12765,39 @@ printf "%s\n" "$ac_cv_sizeof_time_t" >&6; }
 printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h
 
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+printf %s "checking size of void *... " >&6; }
+if test ${ac_cv_sizeof_void_p+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"
+then :
+
+else $as_nop
+  if test "$ac_cv_type_void_p" = yes; then
+     { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+printf "%s\n" "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h
+
+
 SIZEOF_SHORT=$ac_cv_sizeof_short
 SIZEOF_INT=$ac_cv_sizeof_int
 SIZEOF_LONG=$ac_cv_sizeof_long
index 95fd35f305d89aaa019b50f29373853257c67242..35b206e78229c8c1d58803207e8ccb173aed6320 100644 (file)
@@ -1126,6 +1126,7 @@ AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(off_t)
 AC_CHECK_SIZEOF(time_t)
+AC_CHECK_SIZEOF(void *)
 SIZEOF_SHORT=$ac_cv_sizeof_short
 SIZEOF_INT=$ac_cv_sizeof_int
 SIZEOF_LONG=$ac_cv_sizeof_long
index a46451f9994ea7f59f11d7e9483b7f4e3ad610cf..480717abd9b4be65b16c9b594553fe9181dbb11f 100644 (file)
 /* The size of `time_t', as computed by sizeof. */
 #undef SIZEOF_TIME_T
 
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
 /* Define to 1 if all of the C90 standard headers exist (not just the ones
    required in a freestanding environment). This macro is provided for
    backward compatibility; new code need not use it. */
index e7917b0eccf3236041f0bc4330c8fc01f28919d8..624efc0380a492d7ccddc9cb8b43eacbe28f8eaa 100644 (file)
@@ -588,7 +588,11 @@ static errcode_t copy_fs_verity_data(ext2_file_t e2_file, ext2_off_t e2_offset,
        do {
                struct fsverity_read_metadata_arg arg = {
                  .metadata_type = metadata_type,
+#if (SIZEOF_VOID_P == 4)
+                 .buf_ptr = (uint32_t) buf,
+#else
                  .buf_ptr = (uint64_t) buf,
+#endif
                  .length = sizeof(buf),
                  .offset = *written,
                };