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

Commits on Oct 19, 2022

  1. fix: make sure that postject-api.h compiles without warnings

    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 committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    5b5dcee View commit details
    Browse the repository at this point in the history
  2. fix: resolve another compiler warning

    ```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 committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    687cc56 View commit details
    Browse the repository at this point in the history
  3. fix: use -Wall -WX on Windows

    Signed-off-by: Darshan Sen <[email protected]>
    RaisinTen committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    fdb73d4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9809ff4 View commit details
    Browse the repository at this point in the history
  5. fix: another compilation warning on Windows

    ```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]>
    RaisinTen committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    3c4ff65 View commit details
    Browse the repository at this point in the history
  6. fix: compiler warning on Windows

    ```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]>
    RaisinTen committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    2bb8618 View commit details
    Browse the repository at this point in the history
  7. fix: use -EHsc for test.cpp

    ```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]>
    RaisinTen committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    fd31d7f View commit details
    Browse the repository at this point in the history
  8. fix: use / instead of - for Windows compiler options

    Signed-off-by: Darshan Sen <[email protected]>
    RaisinTen committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    9af316e View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. chore: use target_compile_options instead of set

    Signed-off-by: Darshan Sen <[email protected]>
    RaisinTen committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    4a4e386 View commit details
    Browse the repository at this point in the history