]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: mjson: Fix warning about unused variables
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 May 2023 16:41:54 +0000 (18:41 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 May 2023 07:22:46 +0000 (09:22 +0200)
commit16e314150aca771d6509ca79897006f78fd9441c
tree5341aba1072192cb1274f9a0a4b2a63259a5fd47
parentf0e8e79b3b6a6cb0b790b9892f0f654417297c7b
BUILD: mjson: Fix warning about unused variables

clang 15 reports unused variables in src/mjson.c:

  src/mjson.c:196:21: fatal error: expected ';' at end of declaration
    int __maybe_unused n = 0;

and

  src/mjson.c:727:17: fatal error: variable 'n' set but not used [-Wunused-but-set-variable]
    int sign = 1, n = 0;

An issue was created on the project, but it was not fixed for now:

   https://github.com/cesanta/mjson/issues/51

So for now, to fix the build issue, these variables are declared as unused.
Of course, if there is any update on this library, be careful to review this
patch first to be sure it is always required.

This patch should fix the issue #1868. It be backported as far as 2.4.
src/mjson.c