Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !21946

RFC: tree-wide: rename DEBUG to EXPENSIVE_CHECKS to stop the confusion with NDEBUG

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Eric Engestrom requested to merge eric/mesa:rename-debug into main Mar 16, 2023
  • Overview 7
  • Commits 21
  • Pipelines 1
  • Changes 173

There have been countless discussions, confusion & bugs around what DEBUG means/is used for and how it's different from NDEBUG. The latest one that I saw (and which prompted me to finally do something about it) was #4965 but I expect most of you will recall the various times this came up.

It also causes issue with projects like LLVM and Bellagio which make use of such a common name in their headers, leading to workarounds like including a header, undef'ing DEBUG, and re-including the header, or having to undef DEBUG right before including a specific header. These are fragile (new version of these headers might move the code around) and there's a good chance we might forget to add the workaround in new code including these headers, leading to inconsistent behaviour across build types.

Let's finally pick a better name, which I arbitrarily called EXPENSIVE_CHECKS. It should be quite easy to rename it to something else, should someone suggest a better name.


This MR focuses on the rename, let's make sure I didn't sed too much or incorrectly. Fixing code that shouldn't have been using this define is left as an exercise for the reader for follow up MRs, with a couple of exceptions: src/gallium/auxiliary/gallivm/ & src/gallium/frontends/omx/bellagio/ had special code to handle DEBUG being used in other project headers, which is no longer relevant so it has been dropped.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rename-debug