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

"call to undeclared function 'calculate_leadtime_coord'" error in recent Xcode/Clang build for OSX #710

Closed
mauzey1 opened this issue Sep 26, 2023 · 4 comments
Assignees
Labels

Comments

@mauzey1
Copy link
Collaborator

mauzey1 commented Sep 26, 2023

While building CMOR on my Macbook I encountered the following error.

Src/cmor.c:4859:9: error: call to undeclared function 'calculate_leadtime_coord'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        calculate_leadtime_coord(var_id);

I'm currently using Xcode 15.0 on OSX Ventura. I've been building CMOR on my Mac just fine until recently. This issue might have arisen after I rebuilt my Conda environment with the latest version of Clang.

Regardless, the error is caused by the call to the function calculate_leadtime_coord in cmor.c before its declaration. The simplest solution would be to just declare the function near the top of the file.

@mauzey1 mauzey1 self-assigned this Sep 26, 2023
@matthew-mizielinski
Copy link

@piotr-florek-mohc, I'm guessing that you didn't see this when doing the leadtime work?

@piotr-florek-mohc
Copy link
Collaborator

no I haven't - seems like an embarrassingly rookie mistake!

@mauzey1
Copy link
Collaborator Author

mauzey1 commented Sep 27, 2023

I never caught it either until the changes to the compiler flagged it as an error.

@piotr-florek-mohc, if you want to make some fixes to this I could hand this issue over to you. I also noticed there were some functions in the Python wrapper that were meant to point this function until it was decided not to expose it in the API.

@piotr-florek-mohc
Copy link
Collaborator

piotr-florek-mohc commented Sep 27, 2023

Sure, I can fix both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants