Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35460

Phase out integer typedefs and macros in favor of C/C++ Standard ones

Details

    Description

      Back when compiler standardization was a mess, we created equally messy sets of typedefs and macros and toggled between them with ifdef s.

      Starting with 77c184df7c though, we’ve adopted the standards C99 and C++11, which already defines fix-width integers and printf specifiers universally.

      Switching to the standardized typedefs and macros modernizes our code and improves:

      • Readability, especially for new but experienced members from a standardized background.
      • Consistency – int32_t, uint16_t, intptr_t and more are also in use (the last time I checked).
      • Compilation time: marko says these checks slow CMake’s single-threaded setup phase.
      • File sizes (more for deduplication)

      InnoDB misleadingly defines ulint/ULINTPF as size_t/%zu as an hack to solve MDEV-12488. Someone who doesn’t know (like past me) would easily cast it (64-bit on x64) to ulong (32-bit on Windows) by accident. We should directly replace them with size_t/%zu.

      Attachments

        Issue Links

          Activity

            Thank you, ParadoxV5! I filed MDEV-35461 and MDEV-35462 for some related cleanup.

            marko Marko Mäkelä added a comment - Thank you, ParadoxV5 ! I filed MDEV-35461 and MDEV-35462 for some related cleanup.
            SalahTamer Salah Tamer added a comment - - edited

            Hello, I’m interested in working on this task.
            Could you please assign it to me? I’d also appreciate any additional guidance before I start.

            SalahTamer Salah Tamer added a comment - - edited Hello, I’m interested in working on this task. Could you please assign it to me? I’d also appreciate any additional guidance before I start.
            serg Sergei Golubchik added a comment -

            It cannot be assigned to you, the list of allowed assignees is limited to developers with write access.
            But it doesn't matter, you can still work on it and create a pull request, after that the issue will be assigned to the developer who will review and merge your PR.

            serg Sergei Golubchik added a comment - It cannot be assigned to you, the list of allowed assignees is limited to developers with write access. But it doesn't matter, you can still work on it and create a pull request, after that the issue will be assigned to the developer who will review and merge your PR.

            People

              Unassigned Unassigned
              ParadoxV5 Jimmy Hú
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.