https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111802

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>:

https://gcc.gnu.org/g:939439a90f234f9e70d30240bf5c227eebe2b43f

commit r14-9199-g939439a90f234f9e70d30240bf5c227eebe2b43f
Author: David Malcolm <dmalc...@redhat.com>
Date:   Tue Feb 27 14:49:42 2024 -0500

    analyzer: use correct format code for string literal indices
[PR110483,PR111802]

    On e.g. gcc211 the use of "%li" with unsigned HOST_WIDE_INT led to this
warning:
    ../../src/gcc/analyzer/access-diagram.cc: In member function âvoid
ana::string_literal_spatial_item::add_column_for_byte(text_art::table&, const
ana::bit_to_table_map&, text_art::style_manager&, ana::byte_offset_t,
ana::byte_offset_t, int, int) constâ:
    ../../src/gcc/analyzer/access-diagram.cc:1909:40: warning: format â%liâ
expects argument of type âlong intâ, but argument 3 has type âlong long
unsigned intâ [-Wformat=]
              byte_idx_within_string.ulow ()));
                                            ^
    and to all values being erroneously printed as "0".

    Fixed thusly.

    gcc/analyzer/ChangeLog:
            PR analyzer/110483
            PR analyzer/111802
            * access-diagram.cc
            (string_literal_spatial_item::add_column_for_byte): Use %wu for
            printing unsigned HOST_WIDE_INT.

    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Reply via email to