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

deps: suppress warnings in deps/uvwasi/src/uvwasi.c #31139

Closed
wants to merge 1 commit into from

Conversation

HarshithaKP
Copy link
Member

Declaration of function 'seekdir' and 'telldir'
Declaration of function 'strlen'
Refs: #18983

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Declaration of function 'seekdir' and 'telldir'
Declaration of function 'strlen'
@cjihrig
Copy link
Contributor

cjihrig commented Dec 30, 2019

Can you open this against https://github.com/cjihrig/uvwasi first?

@addaleax
Copy link
Member

Also, both of these includes are already present. The reason for the warnings is that there are missing feature macros that enable those functions to be declared from these headers, not that the headers aren’t included.

@HarshithaKP
Copy link
Member Author

@cjihrig Sure I will open this in https://github.com/cjihrig/uvwasi

@HarshithaKP
Copy link
Member Author

@addaleax Yes the header files are already included, thank you for the correction.
Minimal reproduce following node.js build flags

$ cat foo.c

#include <stdio.h>
#include <string.h>

int main() {
  char str[128] = "hello";
  strnlen(str, 4);
  return 0;
}

$ cc -D_POSIX_C_SOURCE=200112 -Wextra foo.c

foo.c: In function 'main':
foo.c:6:3: warning: implicit declaration of function 'strnlen' [-Wimplicit-function-declaration]
   strnlen(str, 4);

I am able to circumvent by defining #define _GNU_SOURCE in the source prior to header file inclusion.

$ cc -D_POSIX_C_SOURCE=200112 -Wextra foo.c
$

Is this a right approach?

HarshithaKP added a commit to HarshithaKP/uvwasi that referenced this pull request Jan 6, 2020
Defined `_GNU_SOURCE` to suppress warnings
thrown during node build from scratch.

Refs: nodejs/node#31139
@addaleax
Copy link
Member

addaleax commented Jan 9, 2020

I’ll close this PR since there is one upstream now and we’ll get that with the next dependency update – thanks for taking this on, though!

@addaleax addaleax closed this Jan 9, 2020
cjihrig pushed a commit to nodejs/uvwasi that referenced this pull request Jan 10, 2020
Define `_GNU_SOURCE` and `_POSIX_C_SOURCE` to suppress
compilation warnings.

Refs: nodejs/node#31139
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