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

compilation warnings: ISO C90 forbids mixing declarations and code #3131

Closed
alzix opened this issue Mar 8, 2021 · 4 comments · Fixed by #3189
Closed

compilation warnings: ISO C90 forbids mixing declarations and code #3131

alzix opened this issue Mar 8, 2021 · 4 comments · Fixed by #3189
Labels

Comments

@alzix
Copy link

alzix commented Mar 8, 2021

  • Version: v1.41.0
  • Platform: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

compilation warning emitted when building with following flags enabled: -Wall -Wextra -pedantic
these warning prevent me from setting -Werror

libuv/src/unix/udp.c:929:3: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
  STATIC_ASSERT(sizeof(mreq.gsr_group) >= sizeof(*multicast_addr));
  ^
In file included from libuv/src/unix/udp.c:23:
In file included from libuv/src/unix/internal.h:25:
libuv/src/uv-common.h:61:8: note: expanded from macro 'STATIC_ASSERT'
  void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
       ^
1 warning generated.
libuv/src/unix/darwin.c:260:26: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
  CFMutableDictionaryRef classes_to_match
                         ^
1 warning generated.
@cjihrig
Copy link
Contributor

cjihrig commented Mar 9, 2021

Thanks for reporting this. Care to send a PR?

cabelitos added a commit to cabelitos/libuv that referenced this issue May 5, 2021
This commit fixes some errors that might arise when compiling
libuv with the pendanting. The error in question is
"ISO C90 forbids mixing declarations and code"

Closes: libuv#3131
@cabelitos
Copy link
Contributor

Hello @alzix and @cjihrig, I was compiling libuv on darwin and I found this problem as well.
I've created a pull request which fixes this problem and also fixes #3161.

I did not want to get into your way @alzix , but if you want I can drop the code and send yours.

@alzix
Copy link
Author

alzix commented May 10, 2021

@cabelitos thank you for the offer - i'll wait an official release

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 2, 2021
bnoordhuis added a commit to bnoordhuis/libuv that referenced this issue Apr 16, 2022
vtjnash pushed a commit that referenced this issue Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants