Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrew gcc-14 new requirements on C code #633

Merged
merged 4 commits into from
May 24, 2024
Merged

Homebrew gcc-14 new requirements on C code #633

merged 4 commits into from
May 24, 2024

Conversation

afni-dglen
Copy link
Contributor

gcc-14 is the latest default version for homebrew with brew install gcc. That latest version of gcc imposes some C code updates like requiring int declarations for functions that return integers. Updates to ignore some warnings with -Wno-implicit-int (f2c code built from Fortran would need to be updated with each conversion) and a couple small other declaration fixes solves the complaints of this version of the gcc compiler.

The libjpeg.a update only occurs in the configure command script it uses to determine compiler properties and not in the AFNI source code.

The libXmHTML code required two small changes for consistent type declarations.

@@ -281,7 +281,7 @@ DestroyImage(XImage *image)
}

static unsigned long
GetPixelWrapper(XImage *ximage, Dimension x, Dimension y)
GetPixelWrapper(XImage *ximage, _XtDimension x, _XtDimension y)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

It might not matter, but I would expect _XtPosition to be more a more appropriate type for x and y.

Copy link
Contributor Author

@afni-dglen afni-dglen May 20, 2024

Choose a reason for hiding this comment

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

That might be. I used _XtDimension because that is the default prototype used in tka.h for the GetPixel function, but this is confusing because the original Dimension is an unsigned int defined in miniparse.h. In Xutil.h (part of the X11 library, provided on the Mac via XQuartz), XGetPixel uses either int directly or the x and y are defined within a macro that calls get_pixel (Xlib.h), which uses int for x and y.

Intrinsic.h in the X11 library specifies _XtDimension as either Dimension (defined as unsigned short) or int depending on whether it is being used with a "wide" variable definition. They also say not to use _XtDimension and similar variable types in client code - not sure if that means XmHTML code.

So either _XtDimension, int, unsigned short or unsigned int seem to be reasonable choices.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, given the prototype, _XtDimension does seem good.

@afni-rickr
Copy link
Contributor

Can you make sure your two SUMA changes are reflected in the 0327 branch? The feel free to merge, thanks.

Copy link
Contributor Author

@afni-dglen afni-dglen left a comment

Choose a reason for hiding this comment

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

Included all changes in the suma20240327 branch too. Tested build against FT05 NL afni_proc script from class data, and all looked good except for numpy2 issues in the QC HTML generation on Mac. Those are outside this pull request. Rerunning with conda-managed numpy1 produced expected QC HTML pages with appropriate visual results.
@afni-rickr - can you do final approval?

@mrneont
Copy link
Contributor

mrneont commented May 24, 2024

What be the QC HTML issues? Let me know if I should take a look.

@afni-rickr afni-rickr merged commit 01084c9 into master May 24, 2024
1 of 3 checks passed
@afni-rickr afni-rickr deleted the gcc14_MacARM branch June 6, 2024 17:36
@afni-rickr afni-rickr restored the gcc14_MacARM branch June 6, 2024 17:36
@afni-rickr afni-rickr deleted the gcc14_MacARM branch June 6, 2024 17:36
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.

None yet

3 participants