Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Compiling

    Description

      Since MDEV-21907 -Wconversion has been enabled for clang and GCC, but only for InnoDB and Mariabackup.

      The -Wconversion flag helps improve code quality and helps prevent surprise build errors on Microsoft Windows and 32 bit.

      Attachments

        Issue Links

          Activity

            Eric_Herman Eric Herman added a comment - - edited

            From https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

            -Wconversion

            Warn for implicit conversions that may alter a value. This includes conversions between real and integer, like abs( x ) when x is double; conversions between signed and unsigned, like unsigned ui = -1; and conversions to smaller types, like sqrtf (M_PI). Do not warn for explicit casts like abs ((int) x) and ui = (unsigned) -1, or if the value is not changed by the conversion like in abs (2.0). Warnings about conversions between signed and unsigned integers can be disabled by using -Wno-sign-conversion.

            For C+, also warn for confusing overload resolution for user-defined conversions; and conversions that never use a type conversion operator: conversions to void, the same type, a base class or a reference to them. Warnings about conversions between signed and unsigned integers are disabled by default in C+ unless -Wsign-conversion is explicitly enabled.

            Warnings about conversion from arithmetic on a small type back to that type are only given with -Warith-conversion.

            Eric_Herman Eric Herman added a comment - - edited From https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -Wconversion Warn for implicit conversions that may alter a value. This includes conversions between real and integer, like abs( x ) when x is double; conversions between signed and unsigned, like unsigned ui = -1; and conversions to smaller types, like sqrtf (M_PI). Do not warn for explicit casts like abs ((int) x) and ui = (unsigned) -1, or if the value is not changed by the conversion like in abs (2.0). Warnings about conversions between signed and unsigned integers can be disabled by using -Wno-sign-conversion. For C+ , also warn for confusing overload resolution for user-defined conversions; and conversions that never use a type conversion operator: conversions to void, the same type, a base class or a reference to them. Warnings about conversions between signed and unsigned integers are disabled by default in C + unless -Wsign-conversion is explicitly enabled. Warnings about conversion from arithmetic on a small type back to that type are only given with -Warith-conversion.
            ParadoxV5 Jimmy Hú added a comment -

            While here, how about enabling -Wformat-signedness as well? Linked doc doesn’t say it’s included in -Wconversion or -Wformat (relates to MDEV-21978) and doesn’t list it in -Wall.

            ParadoxV5 Jimmy Hú added a comment - While here, how about enabling -Wformat-signedness as well? Linked doc doesn’t say it’s included in -Wconversion or -Wformat (relates to MDEV-21978 ) and doesn’t list it in -Wall .

            People

              Unassigned Unassigned
              Eric_Herman Eric Herman
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.