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: make sure that postject-api.h compiles without warnings #54

Merged

Conversation

RaisinTen
Copy link
Contributor

Fixes the following error I came across while integrating Postject in Node.js:

../deps/postject/src/dist/postject-api.h:30:13: error: unused function 'postject_options_init' [-Werror,-Wunused-function]
static void postject_options_init(struct postject_options* options) {
            ^
1 error generated.

Refs: nodejs/node#45038
Signed-off-by: Darshan Sen [email protected]

Fixes the following error I came across while integrating Postject in
Node.js:
```console
../deps/postject/src/dist/postject-api.h:30:13: error: unused function 'postject_options_init' [-Werror,-Wunused-function]
static void postject_options_init(struct postject_options* options) {
            ^
1 error generated.
```

Refs: nodejs/node#45038
Signed-off-by: Darshan Sen <[email protected]>
@RaisinTen RaisinTen changed the title fix: make sure that postject-api.h compiles without warnings fix: make sure that postject-api.h compiles without warnings Oct 19, 2022
@RaisinTen RaisinTen self-assigned this Oct 19, 2022
```console
In file included from /root/project/test/test.c:4:
/root/project/test/../dist/postject-api.h: In function 'postject_find_resource':
/root/project/test/../dist/postject-api.h:96:9: error: unused variable 'ptr' [-Werror=unused-variable]
   96 |   void* ptr = NULL;
      |         ^~~
cc1: all warnings being treated as errors
```

Refs: https://app.circleci.com/pipelines/github/postmanlabs/postject/180/workflows/d0eb47c0-5482-4c85-9c63-aa854ddb0221/jobs/1398?invite=true#step-110-678
Signed-off-by: Darshan Sen <[email protected]>
@RaisinTen RaisinTen force-pushed the fix/make-sure-that-postject-api.h-compiles-without-warnings branch from 433583e to 687cc56 Compare October 19, 2022 08:54
@RaisinTen RaisinTen force-pushed the fix/make-sure-that-postject-api.h-compiles-without-warnings branch from ddc57b6 to fdb73d4 Compare October 19, 2022 12:06
```console
C:\Users\circleci\project\test\../dist/postject-api.h(153,5): error C2220: the following warning is treated as an error [C:\Users\circleci\project\build\test\c_test.vcxproj]
C:\Users\circleci\project\test\../dist/postject-api.h(153,5): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\Users\circleci\project\build\test\c_test.vcxproj]
C:\Users\circleci\project\test\test.c(13,5): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\Users\circleci\project\build\test\c_test.vcxproj]
```

Refs: https://app.circleci.com/pipelines/github/postmanlabs/postject/186/workflows/f1389b9f-c958-4a24-9d6e-28af856ff776/jobs/1455?invite=true#step-107-694
Signed-off-by: Darshan Sen <[email protected]>
```console
C:\Users\circleci\project\test\test.c(13,5): error C2220: the following warning is treated as an error [C:\Users\circleci\project\build\test\c_test.vcxproj]
C:\Users\circleci\project\test\test.c(13,5): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [C:\Users\circleci\project\build\test\c_test.vcxproj]
```

Refs: https://app.circleci.com/pipelines/github/postmanlabs/postject/187/workflows/8bcdcb96-646d-4008-93bf-294e92469b3d/jobs/1464?invite=true#step-107-694
Signed-off-by: Darshan Sen <[email protected]>
```console
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743,1): error C2220: the following warning is treated as an error [C:\Users\circleci\project\build\test\cpp_test.vcxproj]
C:\Users\circleci\project\test\test.cpp(13): message : see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' being compiled [C:\Users\circleci\project\build\test\cpp_test.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\ostream(743,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\circleci\project\build\test\cpp_test.vcxproj]
```

Refs: https://app.circleci.com/pipelines/github/postmanlabs/postject/188/workflows/9107adc5-61a3-41ad-bd60-dd3eb0996765/jobs/1470?invite=true#step-107-696
Signed-off-by: Darshan Sen <[email protected]>
test/CMakeLists.txt Outdated Show resolved Hide resolved
@RaisinTen RaisinTen merged commit b9356bf into main Oct 20, 2022
@RaisinTen RaisinTen deleted the fix/make-sure-that-postject-api.h-compiles-without-warnings branch October 20, 2022 13:16
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