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

[OpenMP] Add an 'stddef.h' include to 'omp.h' #73876

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Nov 30, 2023

Summary:
We use size_t internally in the omp.h header, which is normally
provided by stdlib.h which is already included. Howevever, some cases
when using -ffreestanding can result in this not being defined via
stdlib.h. This patch simply adds an explicit inclusion of this header,
which is provided by the clang resource directory, to resolve this in
all cases.

Summary:
We use `size_t` internally in the omp.h header, which is normally
provided by `stdlib.h` which is already included. Howevever, some cases
when using `-ffreestanding` can result in this not being defined via
`stdlib.h`. This patch simply adds an explicit inclusion of this header,
which is provided by the `clang` resource directory, to resolve this in
all cases.
@carlobertolli
Copy link
Member

Can we test this with a lit test?

Copy link
Member

@jdoerfert jdoerfert left a comment

Choose a reason for hiding this comment

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

Looks simple enough.

@jhuber6
Copy link
Contributor Author

jhuber6 commented Nov 30, 2023

Can we test this with a lit test?

It's pretty trivial, but I can make a freestanding test if you want.

@jhuber6 jhuber6 merged commit 8b9a6af into llvm:main Nov 30, 2023
4 checks passed
Guzhu-AMD pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Dec 7, 2023
Local branch amd-gfx 30878b6 Merged main:fc19424d1d6d into amd-gfx:a5dbf9439804
Remote branch main 8b9a6af [OpenMP] Add an stddef.h include to omp.h (llvm#73876)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants