Skip to content

Add static to functions defined in library header.#14

Merged
connorjward merged 2 commits intofiredrakeproject:mainfrom
lcirrottola:fix/multipleDefinitions
Aug 18, 2025
Merged

Add static to functions defined in library header.#14
connorjward merged 2 commits intofiredrakeproject:mainfrom
lcirrottola:fix/multipleDefinitions

Conversation

@lcirrottola
Copy link
Copy Markdown
Contributor

Hello,

When including "libsupermesh-c.h" in several *.c files, the linker raises a "multiple definition" error for libsupermesh_max_n_tris_c and libsupermesh_max_n_tets_c. In fact these functions are defined (and not just declared) in the header, so they do get defined multiple times when the header is included in different *.c files.

This patch proposes to solve this by adding static keyword to restrict the visibility of these function only to the current translation unit.

@connorjward
Copy link
Copy Markdown
Contributor

Thanks this makes sense. I need to fix CI before this goes in but this should be fine.

@connorjward
Copy link
Copy Markdown
Contributor

That's now done. Can you merge in the latest upstream/main and ping me to let the CI run.

@lcirrottola
Copy link
Copy Markdown
Contributor Author

@connorjward Done! Thanks!

@connorjward
Copy link
Copy Markdown
Contributor

Thanks!

@connorjward connorjward merged commit 59ec7d2 into firedrakeproject:main Aug 18, 2025
3 checks passed
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