Skip to content

CMake MSVC Compiler Errors / Warnings #740

@gabkhanfig

Description

@gabkhanfig

Building usrsctp for CMake with the generator "Visual Studio 17 2022", using C compiler MSVC 19.44.35217.0 has a few compiler errors. One is an actual error, the other two appear to be false positives.

These errors are not replicated when building with nmake.

Actual Errors:

usrsctplib/netinet/sctp_input.c:689

Trying to implicitly convert time_t to uint32_t. An explicit cast is required. sctp_heartbeat_info_param::time_value_1 is set in usrsctplib/netinet/sctp_output.c:12198 from a uint32_t, so the explicit cast here is arguably ok. If preferred, time_value_1 could be changed to be a uint32_t rather than a time_t.

Temporary fix

tv.tv_sec = (uint32_t)(cp->heartbeat.hb_info.time_value_1);

False Positives:

usrsctplib/netinet/sctp_output.c:13561 inp is uninitialized. Initializing to NULL resolves this.
usrsctplib/netinet/sctp_output.c:13564 asoc is uninitialized. Initializing to NULL resolves this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions