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

Deprecated function prototypes in CHOLMOD #337

Closed
orlitzky opened this issue Jun 19, 2023 · 4 comments
Closed

Deprecated function prototypes in CHOLMOD #337

orlitzky opened this issue Jun 19, 2023 · 4 comments
Assignees

Comments

@orlitzky
Copy link

If I compile cholmod with -Werror=strict-prototypes in my CFLAGS, I get a few errors like...

/var/lib/portage/tmp/portage/sci-libs/cholmod-4.0.3/work/SuiteSparse-7.0.0/CHOLMOD/SuiteSparse_metis/GKlib/gk_proto.h:91:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
   91 | int    gk_malloc_init();
      | ^~~

The reason for the error is that the latest C standard draft requires (void) instead of () for prototypes of functions that take no arguments. Why am I shooting myself in the foot, you're thinking? We're trying to avoid compilation errors in the future, when C23 is ratified and people upgrade their compilers:

The fix is trivial and harmless so we're trying to get a head start.

@DrTimothyAldenDavis
Copy link
Owner

Thanks for the feedback. Those errors are coming from another library (METIS) that I've included in SuiteSparse. I can't use an external -lmetis because of various issues in the default METIS library. I've tried to keep my fixes as minimal as possible but didn't check for this issue. I turned on -Wstrict-prototypes for all of SuiteSparse and it looks like this issue is only in METIS (correct me if I'm wrong).

I've fixed the non-standard prototypes in METIS, and just pushed the fix to the dev2 branch. Can you give it a try? If this looks OK, I'll add it to the SuiteSparse v7.1.0.beta2 pre-release, once all the CI passes.

@DrTimothyAldenDavis
Copy link
Owner

See #338

@orlitzky
Copy link
Author

Thanks, METIS (in cholmod) was the only component that gave me problems. I tracked down the upstream project and reported the same issue (KarypisLab/GKlib#27) so that maybe you don't have to be responsible for the fix indefinitely.

@DrTimothyAldenDavis
Copy link
Owner

Thanks -- that's helpful. I would need to manually upgrade to the next release of METIS, since METIS is embedded into SuiteSparse because of some other changes I've had to make (mainly because I have to redefine the integer sizes and memory managers used, which would conflict with a default -lmetis so I move this copy of METIS to a different namespace). The fewer changes I have, the better, however.

This is now fixed in the dev2 branch and will appear in SuiteSparse v7.1.0.beta2, so I'll close this issue now.

Thanks again for the helpful feedback.

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

No branches or pull requests

2 participants