Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2093

Use the C "bool" type for true/false function returns

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.7.0
    • Labels:
      None

      Description

      In a recent code review, there was some discussion about when function returns should be compared against an explicit zero vs if (!func()). The answer is if the function is returning a boolean, but WT has mapped that to the int type for portability.

      However, C has had a bool type since C99 via <stdbool.h>, also supported by Visual Studio 2013 and above.

      Investigate converting WT to use explicit bool types to make it clear when expressions need to be compared against zero.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                michael.cahill Michael Cahill
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: