Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-775

UNINIT_VAR macro - disable for clang

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.3, 3.4
    • 3.4.7, 3.3.17
    • Build
    • None

    Description

      clang based static analyzers and compiles have trouble with a int x=x type macro for UNINIT_VAR.

      sample from MDBF-143, Infer, that uses clang

      #117
      libmariadb/libmariadb/ma_dtoa.c:1306: error: Uninitialized Value
        `ilim` is read without initialization. 
        1304.   */
        1305. 
        1306.   int bbits, b2, b5, be, dig, i, ieps, UNINIT_VAR(ilim), ilim0, 
                                                     ^
        1307.     UNINIT_VAR(ilim1), j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
        1308.     spec_case, try_quick;
       
      #118
      libmariadb/libmariadb/ma_dtoa.c:1307: error: Uninitialized Value
        `ilim1` is read without initialization. 
        1305. 
        1306.   int bbits, b2, b5, be, dig, i, ieps, UNINIT_VAR(ilim), ilim0, 
        1307.     UNINIT_VAR(ilim1), j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
                  ^
        1308.     spec_case, try_quick;
        1309.   Long L;
      

      As found in MDEV-36542, clang, unlike gcc, at least the the C/C and server codebases, even with old clang versions, has not given a false uninitialized value warning.

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.