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

Fix the build when memcpy is defined as a macro. #501

Merged
merged 3 commits into from
Oct 22, 2020
Merged

Conversation

alarixnia
Copy link
Contributor

Parentheses are required around macro argument containing braced initializer list.

memcpy(3) is a macro when using e.g. -D_FORTIFY_SOURCE=2.

Parentheses are required around macro argument containing braced
initializer list.

memcpy(3) is a macro when using e.g. -D_FORTIFY_SOURCE=2.
@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #501 into next will decrease coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #501      +/-   ##
==========================================
- Coverage   36.88%   36.80%   -0.08%     
==========================================
  Files          45       45              
  Lines        8934     8938       +4     
==========================================
- Hits         3295     3290       -5     
- Misses       5639     5648       +9     
Impacted Files Coverage Δ
src/backend/gl/gl_common.c 0.00% <0.00%> (ø)
src/common.h 66.66% <0.00%> (-2.57%) ⬇️
src/log.c 61.90% <0.00%> (-0.60%) ⬇️
src/win.c 63.90% <0.00%> (-0.42%) ⬇️

@tryone144
Copy link
Collaborator

tryone144 commented Oct 3, 2020

Thanks for the fix!

You can also make clang-format happy by letting it format the files you have changed. 😉
If your editor does not support this you can do so manually with

$ clang-format -style=file -i PATH_TO_FILE

or use git-clang-format if that's available on your system.

@yshui
Copy link
Owner

yshui commented Oct 22, 2020

@Niacat Honestly this feels like a libc bug. They should know that they need to put parentheses around macro arguments.

BTW, I don't think glibc does this. What is your platform?

@yshui
Copy link
Owner

yshui commented Oct 22, 2020

Ah, I was wrong. The initializer has commas, so it has to be wrapped in parentheses.

@yshui yshui merged commit 8f78b9b into yshui:next Oct 22, 2020
@yshui
Copy link
Owner

yshui commented Oct 22, 2020

@Niacat Thanks!

yshui pushed a commit that referenced this pull request Oct 24, 2020
Parentheses are required around macro argument containing braced
initializer list.

memcpy(3) is a macro when using e.g. -D_FORTIFY_SOURCE=2.
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.

3 participants