Skip to content

Conversation

@lijun99
Copy link
Contributor

@lijun99 lijun99 commented Nov 7, 2024

I fixed some code which are reported as "incorrect pointer/type" error by newer versions of gcc. The updated code can be compiled by Apple Clang as well.

@CunrenLiang, please make sure the changes don't break the code.

@lijun99
Copy link
Contributor Author

lijun99 commented Nov 7, 2024

Sorry, my editor prefers to remove all the empty spaces in the end. The actual changes are not that many,

  1. snaphu.h, snaphu_utils.c, change the IsFinite function to int type, and use isfinite function from math.h;
  2. contrib/alos2filter/src/psfilt1.c change the
    p_forward = fftwf_plan_dft_2d(fftw, fftw, (fftw_complex *)seg_fft[0], (fftw_complex *)seg_fft[0], FFTW_FORWARD, FFTW_MEASURE);
    p_backward = fftwf_plan_dft_2d(fftw, fftw, (fftw_complex *)seg_fft[0], (fftw_complex *)seg_fft[0], FFTW_BACKWARD, FFTW_MEASURE);
    to
    p_forward = fftwf_plan_dft_2d(fftw, fftw, (fftwf_complex *)seg_fft[0], (fftwf_complex *)seg_fft[0], FFTW_FORWARD, FFTW_MEASURE);
    p_backward = fftwf_plan_dft_2d(fftw, fftw, (fftwf_complex *)seg_fft[0], (fftwf_complex *)seg_fft[0], FFTW_BACKWARD, FFTW_MEASURE);
    since fftw_complex is of double type.
    also changed the IsFinite function;
  3. graphx_mdx.c, enforce a type conversion for XmProcessTraversal: it returns a bool, but the XtCallbackProc should be a void type.

@bjmarfito
Copy link
Contributor

Tested on Linux and macOS with GCC 14 and it works. Thank you @lijun99!

Can this be tested and merged @rtburns-jpl since we have a new system and we can only use GCC 14 and newer? Thanks!

@rtburns-jpl rtburns-jpl merged commit 51b9c6c into isce-framework:main Nov 19, 2024
@rtburns-jpl rtburns-jpl deleted the modern-c branch November 19, 2024 00:15
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.

3 participants