Skip to content

Conversation

@jwlodek
Copy link
Member

@jwlodek jwlodek commented Jul 1, 2025

…o fail

w/o this change, on RHEL 10, we get:

../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:288:9: error: initialization of ‘int (*)(int *, int,  int,  int,  int,  int)’ from incompatible pointer type ‘int (*)(jpc_fix_t *, int,  int,  int,  int,  int)’ {aka ‘int (*)(long int *, int,  int,  int,  int,  int)’} [-Wincompatible-pointer-types]
  288 |         jpc_ft_analyze,
      |         ^~~~~~~~~~~~~~
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:288:9: note: (near initialization for ‘jpc_ft_qmfb2d.analyze’)
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:295:9: error: initialization of ‘int (*)(int *, int,  int,  int,  int,  int)’ from incompatible pointer type ‘int (*)(jpc_fix_t *, int,  int,  int,  int,  int)’ {aka ‘int (*)(long int *, int,  int,  int,  int,  int)’} [-Wincompatible-pointer-types]
  295 |         jpc_ns_analyze,
      |         ^~~~~~~~~~~~~~
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:295:9: note: (near initialization for ‘jpc_ns_qmfb2d.analyze’)
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:296:9: error: initialization of ‘int (*)(int *, int,  int,  int,  int,  int)’ from incompatible pointer type ‘int (*)(jpc_fix_t *, int,  int,  int,  int,  int)’ {aka ‘int (*)(long int *, int,  int,  int,  int,  int)’} [-Wincompatible-pointer-types]
  296 |         jpc_ns_synthesize,
      |         ^~~~~~~~~~~~~~~~~
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:296:9: note: (near initialization for ‘jpc_ns_qmfb2d.synthesize’)
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c: In function ‘jpc_ft_synthesize’:
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:1607:18: error: assignment to ‘jpc_fix_t *’ {aka ‘long int *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
 1607 |         startptr = &a[0];
      |                  ^
../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/jpc/jpc_qmfb.c:1615:18: error: assignment to ‘jpc_fix_t *’ {aka ‘long int *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
 1615 |         startptr = &a[0];
      |                  ^
make[6]: *** [/epics/utils/epics-rpm-config/BUILD/base/configure/RULES_BUILD:260: jpc_qmfb.o] Error 1

The reason this is necessary is as follows:

The implementation of the jpc_{ft,ns}_{synthesize,analyze} functions assume its
first argument is a pointer to jpc_fix_t, as all of them will copy it to a
local variable called startptr of this type. Because on some systems jpc_fix_t
is a long int, we might get a compilation error, as it happens on RHEL 10.

Change the type of the jpc_ft_synthesize argument so there is not an
incompatible pointer assignment. Changing the signature of analyze and
synthesize fields in the jpc_qmfb2d_t struct is also needed because the
aforementioned functions will be assigned to them. Similarly,
jpc_tsfb_synthesize2() calls synthesize but mistakenly declares its forwarded
argument as int*.

The same fix was applied as part of this commit: jasper-software/jasper@d743f7e in the upstream repository.

Once merged, could we make a new tag/released version?

Copy link
Member

@henriquesimoes henriquesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a backport of some kind? If so, it would be helpful to have the upstream patches linked in the commit message.

Here goes some suggestions regarding the patch series organization, so that it becomes easier to review (now and by future developers).

@jwlodek jwlodek force-pushed the fix-build-rhel-10 branch from 1b6baab to 1727e73 Compare October 1, 2025 11:08
@jwlodek
Copy link
Member Author

jwlodek commented Oct 1, 2025

I've added a link to the upstream commit that also makes this change (among other things), and I've squashed the three commits into one..

@henriquesimoes
Copy link
Member

I've added a link to the upstream commit that also makes this change (among other things).

Okay. Thanks. That makes it a bit easier to double check that everything is correct.

and I've squashed the three commits into one..

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants