Hi Dominique,

Both patches pushed, thanks :)

/Kim


On 2026-09-02 14:56, Dominique Leuenberger wrote:
32-bit ARM architectures (like armv6l and armv7l) enforce strict
alignment requirements for certain complex variables like `sigjmp_buf`
(which often requires 8-byte alignment due to vector/VFP registers).

When casting the generic `jpeg_error_mgr *` pointer (`jcp->err` which
only
guarantees 4-byte alignment) to the larger internal `ImLib_JPEG_data
*`,
GCC flags an alignment promotion error under `-Werror=cast-align`.

Because `struct jpeg_error_mgr` is guaranteed to be the first member
of `ImLib_JPEG_data`, their memory offsets are structurally identical.
Fix this by routing the cast through an intermediate `void *` pointer,
safely indicating to the compiler that alignment constraints are
respected
and clearing the build failure on 32-bit ARM toolchains.
---
  src/modules/loaders/loader_jpeg.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/modules/loaders/loader_jpeg.c
b/src/modules/loaders/loader_jpeg.c
index 75e1ab2..e4a88a2 100644
--- a/src/modules/loaders/loader_jpeg.c
+++ b/src/modules/loaders/loader_jpeg.c
@@ -19,7 +19,7 @@ typedef struct {
  static void
  _JPEGFatalErrorHandler(j_common_ptr jcp)
  {
-    ImLib_JPEG_data *jd = (ImLib_JPEG_data *) jcp->err;
+    ImLib_JPEG_data *jd = (ImLib_JPEG_data *)(void *) jcp->err;

  #if 0
      jcp->err->output_message(jcp);
@@ -31,7 +31,7 @@ static void
  _JPEGErrorHandler(j_common_ptr jcp)
  {
  #if 0
-    ImLib_JPEG_data *jd = (ImLib_JPEG_data *) jcp->err;
+    ImLib_JPEG_data *jd = (ImLib_JPEG_data *)(void *) jcp->err;

      jcp->err->output_message(jcp);
      siglongjmp(jd->setjmp_buffer, 1);
@@ -42,7 +42,7 @@ static void
  _JPEGErrorHandler2(j_common_ptr jcp, int msg_level)
  {
  #if 0
-    ImLib_JPEG_data *jd = (ImLib_JPEG_data *) jcp->err;
+    ImLib_JPEG_data *jd = (ImLib_JPEG_data *)(void *) jcp->err;

      jcp->err->output_message(jcp);
      siglongjmp(jd->setjmp_buffer, 1);



_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to