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

[Bug]: Use of #warning in codebase causes error on Windows #8477

Open
res0nance opened this issue Feb 20, 2025 · 3 comments
Open

[Bug]: Use of #warning in codebase causes error on Windows #8477

res0nance opened this issue Feb 20, 2025 · 3 comments
Assignees
Labels

Comments

@res0nance
Copy link
Contributor

Contact Details

No response

Version

v5.7.6

Description

The codebase has heavy use of #warning e.g

#warning "No configuration for wolfSSL detected, check header order"

This usage is invalid on windows as cl does not recognize the #warning directive. This will result in build failure to what should amount as a warning to the user which seems to be unintended by the developers.

Reproduction steps

No response

Relevant log output

@res0nance res0nance added the bug label Feb 20, 2025
@embhorn embhorn self-assigned this Feb 20, 2025
@embhorn
Copy link
Member

embhorn commented Feb 20, 2025

Hi @res0nance

We do support building in VS and with MSVC tools:

wolfssl/INSTALL

Lines 29 to 31 in 93000e5

4. Building on Windows
Use the Visual Studio Solution wolfssl64.sln

Could you tell us how you are building the library?

Thanks,
@embhorn - wolfSSL Support

@res0nance
Copy link
Contributor Author

Hi @res0nance

We do support building in VS and with MSVC tools:

wolfssl/INSTALL

Lines 29 to 31 in 93000e5

  1. Building on Windows

    Use the Visual Studio Solution wolfssl64.sln
    Could you tell us how you are building the library?

Thanks, @embhorn - wolfSSL Support

In my case it has to do with importing a built library thru CMake. While the form of building is different. I think the codebase as a whole should properly handle #warning there are spots in the codebase where this is handled correctly but in other places it is not.

@embhorn
Copy link
Member

embhorn commented Feb 20, 2025

The #warning is handled as a #pragma message() in a few spots where we expect the compiler to hit. In that particular case, the library built with MSVC tools should always configure with WOLFSSL_USER_SETTINGS enabled, so it would be unexpected to hit that line. The application also needs to define WOLFSSL_USER_SETTINGS in order use the right wolfSSL configuration.

PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WOLFSSL_USER_SETTINGS"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants