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

[Question] many conversion warnings at compilation time #1004

Open
enricovittorini opened this issue Feb 27, 2025 · 3 comments · May be fixed by #870
Open

[Question] many conversion warnings at compilation time #1004

enricovittorini opened this issue Feb 27, 2025 · 3 comments · May be fixed by #870
Labels
question Issue can be closed by providing information

Comments

@enricovittorini
Copy link

would like to understand why the minimal example report so many warning:

crow version: v1.2.1.2


\crow\mustache.h(116,48): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
\crow\mustache.h(97,33): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
\crow\json.h(1747,32): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data
\crow\json.h(1265,35): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
\crow\http_parser_merged.h(607,32): warning C4244: '=': conversion from '__int64' to 'unsigned long', possible loss of data
\crow\http_parser_merged.h(587,32): warning C4244: '=': conversion from '__int64' to 'unsigned long', possible loss of data


#ifdef _WIN64
#define _WIN32_WINNT 0x0A00  // Windows 10
#endif  // End of _WIN64 check

#include "crow.h"

void main() {

    crow::SimpleApp app; //define your crow application

    //define your endpoint at the root directory
    CROW_ROUTE(app, "/")([]() {
        return "Hello world";
        });

    //set the port, set the app to run on multiple threads, and run the app
    app.port(18080).multithreaded().run();
}
@gittiver gittiver added the question Issue can be closed by providing information label Feb 27, 2025
@gittiver
Copy link
Member

Because we enabled this warnings some time ago for all systems and nobody was fixing them up to now.
It is easy to introduce new bugs by fixing them in my experience.

There is a draft for a pull request to fix them: #870
Hadn't the time to come back to the problem.

@bcncpp
Copy link

bcncpp commented Feb 27, 2025

The pr looks good do you have tests? The only concern can be multiplatfrom compatibilty.

@gittiver
Copy link
Member

i used the existing tests, the ci builds and test on ubuntu, windows and macOS.

@gittiver gittiver changed the title [Question] many convesion warning at compilation time [Question] many conversion warnings at compilation time Feb 27, 2025
@gittiver gittiver linked a pull request Feb 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue can be closed by providing information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants