Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15193

appendNum(bool) uses implementation specific behavior

    • Fully Compatible
    • ALL

      In BufBuilder there is a method appendNum(bool) defined as such:

             void appendNum(bool j) {                                                                                                                                                                                                              
                  *((bool*)grow(sizeof(bool))) = j;                                                                                                                                                                                                 
              }  
      

      The C++ standard explicitly states that the size of a bool is implementation defined. This method should be removed or rewritten, and the codebase should be audited for any uses of it.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            adam.midvidy Adam Midvidy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: