Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial code improvements with respect to Clang 19 warnings #1516

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Aug 17, 2024

  1. Row_printNanoseconds() code portability improvements

    Add explicit casts to fix the "-Wshorten-64-to-32" warning (enabled by
    default in Clang 19).
    
    Also shorten the type width for some local variables (where "uint32_t"
    is enough and no need for "unsigned long").
    
    Signed-off-by: Kang-Che Sung <[email protected]>
    Explorer09 committed Aug 17, 2024
    Configuration menu
    Copy the full SHA
    2726d0e View commit details
    Browse the repository at this point in the history
  2. Use size_t for offsets in Text & Graph meter routines

    Don't assume a meter's caption string length will fit the type of
    'int'. Use 'size_t' for the string lengths instead. Even though an
    overflow on the string length is unlikely, this makes the code more
    robust.
    
    Signed-off-by: Kang-Che Sung <[email protected]>
    Explorer09 committed Aug 17, 2024
    Configuration menu
    Copy the full SHA
    677acbd View commit details
    Browse the repository at this point in the history
  3. Use 'unsigned int' for Header column numbers

    Change return type of HeaderLayout_getColumns() from 'size_t' to
    'unsigned int', and use 'unsigned int' type for all Header column
    iterators.
    
    Using 'size_t' is unnecessary (you cannot have 2^32 columns anyway)
    and would cause "-Wshorten-64-to-32" warnings (enabled by default in
    Clang 19).
    Explorer09 committed Aug 17, 2024
    Configuration menu
    Copy the full SHA
    3718c39 View commit details
    Browse the repository at this point in the history