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

    XMLWordPrintable

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

            People

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