From 84eaa948420fe492cb2c762f04eb17596df9edce Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 15 Sep 2025 17:55:11 +0200 Subject: [PATCH] plug-ins: align with __attribute__ keyword. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug in old Bugzilla #138357 report was happening on icc on ia64 with -no-gcc option. It does look like after all these years, this is still a GCC attribute, but we use the same attributes on babl and GEGL code. So to be fair, it'd be useless to only forbid using it on GIMP code. And that makes for much less ugly code. Note that C11 has _Alignas() and C23 alignas() specifiers. These are standard, but we are typically still more into C99 code. Let's see if we move on to C11 some day… But for now, let's use __attribute__. Also I am unsure how much this issue is still relevant nowadays. Maybe even without specified alignment, it would now work fine with icc on IA-64. 🤷 Or maybe it really doesn't matter that much because Itanium has been discontinued in 2019, though I guess existing hardware will still be around for a bit longer. --- plug-ins/file-jpeg/jpeg.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plug-ins/file-jpeg/jpeg.h b/plug-ins/file-jpeg/jpeg.h index efb9affe7f..8c660bfa75 100644 --- a/plug-ins/file-jpeg/jpeg.h +++ b/plug-ins/file-jpeg/jpeg.h @@ -32,15 +32,14 @@ typedef struct my_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */ -#ifdef __ia64__ /* Ugh, the jmp_buf field needs to be 16-byte aligned on ia64 and some - * glibc/icc combinations don't guarantee this. So we pad. See bug #138357 - * for details. + * glibc/icc combinations don't guarantee this. + * See: https://bugzilla.gnome.org/show_bug.cgi?id=138357 + * + * We used to pad with a dummy variable, but I believe using the + * aligned attribute should be fine by now. */ - long double dummy; -#endif - - jmp_buf setjmp_buffer; /* for return to caller */ + jmp_buf setjmp_buffer __attribute__((aligned(16))); /* for return to caller */ } *my_error_ptr; typedef enum