[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #23568 [Core Tor/Tor]: [PATCH] fix format issues in zstd code on 32 bit



#23568: [PATCH] fix format issues in zstd code on 32 bit
----------------------------+------------------------------------
 Reporter:  andreasstieger  |          Owner:  (none)
     Type:  defect          |         Status:  needs_review
 Priority:  Medium          |      Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor    |        Version:  Tor: 0.3.1.7
 Severity:  Normal          |     Resolution:
 Keywords:  zstd            |  Actual Points:
Parent ID:                  |         Points:
 Reviewer:                  |        Sponsor:
----------------------------+------------------------------------
Changes (by nickm):

 * status:  new => needs_review
 * milestone:   => Tor: 0.3.1.x-final


Old description:

> Warnings/errors when building 0.3.1.7 on 32 bit, introduced in 380736d
> (tor-0.3.1.1-alpha)
>
> [  103s] src/common/compress_zstd.c: In function
> 'tor_zstd_get_version_str':
> [  103s] src/common/compress_zstd.c:65:19: error: format '%lu' expects
> argument of type 'long unsigned int', but argument 4 has type 'size_t
> {aka unsigned int}' [-Werror=format=]
> [  103s]                 "%lu.%lu.%lu",
> [  103s]                  ~~^
> [  103s]                  %u
> [  103s]                 version_number / 10000 % 100,
> [  103s]                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [  103s] src/common/compress_zstd.c:65:23: error: format '%lu' expects
> argument of type 'long unsigned int', but argument 5 has type 'size_t
> {aka unsigned int}' [-Werror=format=]
> [  103s]                 "%lu.%lu.%lu",
> [  103s]                      ~~^
> [  103s]                      %u
> [  103s] src/common/compress_zstd.c:67:16:
> [  103s]                 version_number / 100 % 100,
> [  103s]                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
> [  103s] src/common/compress_zstd.c:65:27: error: format '%lu' expects
> argument of type 'long unsigned int', but argument 6 has type 'size_t
> {aka unsigned int}' [-Werror=format=]
> [  103s]                 "%lu.%lu.%lu",
> [  103s]                          ~~^
> [  103s]                          %u
> [  103s] src/common/compress_zstd.c:68:16:
> [  103s]                 version_number % 100);
> [  103s]                 ~~~~~~~~~~~~~~~~~~~~`
>
> %zu should be used here.
>
> Tested on i586, x86_64, ppc, ppc64, aarch64, armv7. All on GNU gcc 7.2.1
> on openSUSE.

New description:

 Warnings/errors when building 0.3.1.7 on 32 bit, introduced in 380736d
 (tor-0.3.1.1-alpha)
 {{{
 [  103s] src/common/compress_zstd.c: In function
 'tor_zstd_get_version_str':
 [  103s] src/common/compress_zstd.c:65:19: error: format '%lu' expects
 argument of type 'long unsigned int', but argument 4 has type 'size_t {aka
 unsigned int}' [-Werror=format=]
 [  103s]                 "%lu.%lu.%lu",
 [  103s]                  ~~^
 [  103s]                  %u
 [  103s]                 version_number / 10000 % 100,
 [  103s]                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 [  103s] src/common/compress_zstd.c:65:23: error: format '%lu' expects
 argument of type 'long unsigned int', but argument 5 has type 'size_t {aka
 unsigned int}' [-Werror=format=]
 [  103s]                 "%lu.%lu.%lu",
 [  103s]                      ~~^
 [  103s]                      %u
 [  103s] src/common/compress_zstd.c:67:16:
 [  103s]                 version_number / 100 % 100,
 [  103s]                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 [  103s] src/common/compress_zstd.c:65:27: error: format '%lu' expects
 argument of type 'long unsigned int', but argument 6 has type 'size_t {aka
 unsigned int}' [-Werror=format=]
 [  103s]                 "%lu.%lu.%lu",
 [  103s]                          ~~^
 [  103s]                          %u
 [  103s] src/common/compress_zstd.c:68:16:
 [  103s]                 version_number % 100);
 [  103s]                 ~~~~~~~~~~~~~~~~~~~~`
 }}}
 %zu should be used here.

 Tested on i586, x86_64, ppc, ppc64, aarch64, armv7. All on GNU gcc 7.2.1
 on openSUSE.

--

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23568#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs