Skip to content

Werror makes compilation fail on MinGW64 #807

Description

@FrostKiwi

Initially reported as an issue libdatachannel in paullouisageneau/libdatachannel#1528

libsrtp 2.8.0 needs target_compile_options(srtp2 PRIVATE -Wno-error=format) in order to not fail building with toolchain CLANG + MinGW64 + UCRT as installed by https://scoop.sh/#/apps?q=mingw-mstorsjo-llvm-ucrt&id=4e35bf42629409cf7722249d1b574c84d2d19675

[16/402] Building C object _deps/libdatachannel-build/deps/libsrtp/CMakeFiles/srtp2.dir/srtp/srtp.c.obj
FAILED: [code=1] _deps/libdatachannel-build/deps/libsrtp/CMakeFiles/srtp2.dir/srtp/srtp.c.obj
C:\Users\artsimow\scoop\apps\mingw-mstorsjo-llvm-ucrt\current\bin\clang.exe -DHAVE_CONFIG_H -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -IC:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-build/deps/libsrtp -IC:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/crypto/include -IC:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/include -IC:/Users/artsimow/myMachineConnector/buildRel/_deps/mbedtls-src/include -O3 -DNDEBUG -std=gnu99 -fansi-escape-codes -fcolor-diagnostics -Wall -Wextra -Wshadow -Wpedantic -Wunused -Wnull-dereference -Wdouble-promotion -Wcast-qual -Werror -MD -MT _deps/libdatachannel-build/deps/libsrtp/CMakeFiles/srtp2.dir/srtp/srtp.c.obj -MF _deps\libdatachannel-build\deps\libsrtp\CMakeFiles\srtp2.dir\srtp\srtp.c.obj.d -o _deps/libdatachannel-build/deps/libsrtp/CMakeFiles/srtp2.dir/srtp/srtp.c.obj -c C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/srtp/srtp.c
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/srtp/srtp.c:667:60: error: format specifies type 'unsigned int' but the argument has type 'u_long' (aka 'unsigned long') [-Werror,-Wformat]
  667 |     debug_print(mod_srtp, "cloning stream (SSRC: 0x%08x)", ntohl(ssrc));
      |                                                    ~~~~    ^~~~~~~~~~~
      |                                                    %08lx
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/crypto/include/err.h:139:75: note: expanded from macro 'debug_print'
  139 |     srtp_err_report(srtp_err_level_debug, ("%s: " format "\n"), mod.name, arg)
      |                                                   ~~~~~~                  ^~~
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/srtp/srtp.c:2785:25: error: format specifies type 'unsigned int' but the argument has type 'u_long' (aka 'unsigned long') [-Werror,-Wformat]
 2784 |             debug_print(mod_srtp, "using provisional stream (SSRC: 0x%08x)",
      |                                                                      ~~~~
      |                                                                      %08lx
 2785 |                         ntohl(hdr->ssrc));
      |                         ^~~~~~~~~~~~~~~~
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/crypto/include/err.h:139:75: note: expanded from macro 'debug_print'
  139 |     srtp_err_report(srtp_err_level_debug, ("%s: " format "\n"), mod.name, arg)
      |                                                   ~~~~~~                  ^~~
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/srtp/srtp.c:4550:25: error: format specifies type 'unsigned int' but the argument has type 'u_long' (aka 'unsigned long') [-Werror,-Wformat]
 4549 |                         "srtcp using provisional stream (SSRC: 0x%08x)",
      |                                                                  ~~~~
      |                                                                  %08lx
 4550 |                         ntohl(hdr->ssrc));
      |                         ^~~~~~~~~~~~~~~~
C:/Users/artsimow/myMachineConnector/buildRel/_deps/libdatachannel-src/deps/libsrtp/crypto/include/err.h:139:75: note: expanded from macro 'debug_print'
  139 |     srtp_err_report(srtp_err_level_debug, ("%s: " format "\n"), mod.name, arg)
      |

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