Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6650

LINT_INIT emits code in non-debug builds

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.5.39, 10.0.13, 10.1.1
    • 10.1.4
    • OTHER
    • None

    Description

      Leaving variables uninitialized in certain cases helps to achieve top-notch performance. Sometimes compiler thinks that variable may be used uninitialized (whereas it may not) and emits a warning.

      To silence these warnings there is LINT_INIT() macro:

      #if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
          (defined(__GNUC__) && defined(__cplusplus))
      #define LINT_INIT(var) var= 0
      #else
      #define LINT_INIT(var)
      #endif

      It always emits "x= 0" for C++ code compiled with gcc. In fact this is a workaround for gcc bug, which was fixed 3 years ago.

      Attachments

        Issue Links

          Activity

            svoj Sergey Vojtovich created issue -
            svoj Sergey Vojtovich made changes -
            Field Original Value New Value
            serg Sergei Golubchik made changes -
            Affects Version/s 5.5.39 [ 16301 ]
            Affects Version/s 10.0.13 [ 16300 ]
            Affects Version/s 5.5 [ 15800 ]
            Affects Version/s 10.0 [ 16000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.1.1 [ 16801 ]

            serg, please review fix for this bug.

            svoj Sergey Vojtovich added a comment - serg , please review fix for this bug.
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Sergei Golubchik [ serg ]
            Status Open [ 1 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sergey Vojtovich [ svoj ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            Component/s OTHER [ 10125 ]
            Fix Version/s 10.1.4 [ 18400 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 53217 ] MariaDB v3 [ 65399 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 65399 ] MariaDB v4 [ 148165 ]

            People

              svoj Sergey Vojtovich
              svoj Sergey Vojtovich
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.