Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2714

logger.c:204:41: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • proton-c-0.38.0
    • proton-c-0.40.0
    • proton-c
    • None

    Description

      These don't actually produce compiler diagnostics, that only appears after the printing functions are annotated. So this is not causing compilation failures currently.

      /home/jdanek/repos/qpid/qpid-proton/c/src/ssl/openssl.c: In function ‘process_input_ssl’:
      /home/jdanek/repos/qpid/qpid-proton/c/src/ssl/openssl.c:1039:70: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
       1039 |   ssl_log( transport, PN_LEVEL_TRACE, "process_input_ssl( data size=%d )",available );
            |                                                                     ~^    ~~~~~~~~~
            |                                                                      |    |
            |                                                                      int  size_t {aka long unsigned int}
            |                                                                     %ld
      cc1: all warnings being treated as errors
      gmake[2]: *** [c/CMakeFiles/qpid-proton-core-static.dir/build.make:520: c/CMakeFiles/qpid-proton-core-static.dir/src/ssl/openssl.c.o] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:1375: c/CMakeFiles/qpid-proton-core-static.dir/all] Error 2
      gmake: *** [Makefile:146: all] Error 2
      
      /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c: In function ‘pni_logger_log_raw’:
      /home/jdanek/repos/qpid/qpid-proton/c/src/core/logger.c:204:41: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
        204 |     pn_fixed_string_addf(&out, "%04x/%04x: ", i, size);
            |                                      ~~~^        ~~~~
            |                                         |        |
            |                                         |        size_t {aka long unsigned int}
            |                                         unsigned int
            |                                      %04lx
      cc1: all warnings being treated as errors
      

      Attachments

        Activity

          People

            jdanek Jiri Daněk
            jdanek Jiri Daněk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: