This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 519ce54dd492eb4b0f789a7a9dc7e8131f13cf88
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 30 11:49:24 2024 +0100

    encoding/json: Use unsigned type for bitfield
    
    Enabling -Wsingle-bit-bitfield-constant-conversion compains.
    repos/apache-mynewt-core/encoding/json/src/json_encode.c:187:27: error:
        implicit truncation from 'int' to a one-bit wide bit-field changes
        value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
    562
        encoder->je_wr_commas = 1;
    563
                              ^ ~
    564
    repos/apache-mynewt-core/encoding/json/src/json_encode.c:199:27: error:
        implicit truncation from 'int' to a one-bit wide bit-field changes
        value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
    565
        encoder->je_wr_commas = 1;
    566
                              ^ ~
    567
    repos/apache-mynewt-core/encoding/json/src/json_encode.c:233:27: error:
        implicit truncation from 'int' to a one-bit wide bit-field changes
        value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
    568
        encoder->je_wr_commas = 1;
    569
                              ^ ~
    570
    repos/apache-mynewt-core/encoding/json/src/json_encode.c:244:27: error:
        implicit truncation from 'int' to a one-bit wide bit-field changes
        value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
    571
        encoder->je_wr_commas = 1;
    572
                              ^ ~
---
 encoding/json/include/json/json.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/encoding/json/include/json/json.h 
b/encoding/json/include/json/json.h
index f6a4d0609..93de54c8d 100644
--- a/encoding/json/include/json/json.h
+++ b/encoding/json/include/json/json.h
@@ -83,7 +83,7 @@ typedef int (*json_write_func_t)(void *buf, char *data,
 struct json_encoder {
     json_write_func_t je_write;
     void *je_arg;
-    int je_wr_commas:1;
+    unsigned int je_wr_commas : 1;
     char je_encode_buf[64];
 };
 

Reply via email to