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

Windows debug: Run-Time Check Failure #3 - The variable 'unused' is being used without being initialized

Details

    Description

      http://buildbot.askmonty.org/buildbot/builders/win32-debug2/builds/6784/steps/build/logs/stdio

      128>  CMake Error at C:/bzr/bb-win32/win32-debug2/build/sql/create_initial_db.cmake:84 (MESSAGE):
       
      128>    Could not create initial database
       
      128>CUSTOMBUILD : error : Run-Time Check Failure #3 - The variable 'unused' is being used without being initialized. At c:\bzr\bb-win32\win32-debug2\build\sql-common\client_plugin.c:258

      Started happening from this revision:

      revno: 4394
      revision-id: svoj@mariadb.org-20141219191759-zi3qaqyj0vvkh0ba
      parent: sergii@pisem.net-20141219104403-wo7bvoif9zii3ie5
      committer: Sergey Vojtovich <svoj@mariadb.org>
      branch nick: 5.5
      timestamp: Fri 2014-12-19 23:17:59 +0400
      message:
        Fixed a couple of compiler warnings.

      Attachments

        Issue Links

          Activity

            holyfoot, could you have a look at this?

            This build failed on warnings. It seem to be enabled implicitly by "cmake --build . --config Debug", that is by Debug project configuration. See MSVC manual for build configurations description: http://msdn.microsoft.com/en-us/library/wx0123s5.aspx

            For such builds we should add definition of FORCE_INIT_OF_VARS. Probably the easiest way is to add set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORCE_INIT_OF_VARS) to cmake/Windows.cmake.

            svoj Sergey Vojtovich added a comment - holyfoot , could you have a look at this? This build failed on warnings. It seem to be enabled implicitly by "cmake --build . --config Debug", that is by Debug project configuration. See MSVC manual for build configurations description: http://msdn.microsoft.com/en-us/library/wx0123s5.aspx For such builds we should add definition of FORCE_INIT_OF_VARS. Probably the easiest way is to add set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORCE_INIT_OF_VARS) to cmake/Windows.cmake.

            The problem was already fixed in 10.0.16 by the revision below; but on 5.5 the build still fails.

            revno: 4587
            revision-id: sergii@pisem.net-20150123131738-ia1mjsnd383fmmg0
            parent: knielsen@knielsen-hq.org-20150123125646-4lazb1074epizgyg
            committer: Sergei Golubchik <sergii@pisem.net>
            branch nick: 10.0
            timestamp: Fri 2015-01-23 14:17:38 +0100
            message:
              win32-debug build failure

            elenst Elena Stepanova added a comment - The problem was already fixed in 10.0.16 by the revision below; but on 5.5 the build still fails. revno: 4587 revision-id: sergii@pisem.net-20150123131738-ia1mjsnd383fmmg0 parent: knielsen@knielsen-hq.org-20150123125646-4lazb1074epizgyg committer: Sergei Golubchik <sergii@pisem.net> branch nick: 10.0 timestamp: Fri 2015-01-23 14:17:38 +0100 message: win32-debug build failure

            Same fix pushed to the 5.5.
            In the future though i think the nicer fix is to turn /nowarn:42024 switch on,
            so the VC won't warn the unused local variables.

            holyfoot Alexey Botchkov added a comment - Same fix pushed to the 5.5. In the future though i think the nicer fix is to turn /nowarn:42024 switch on, so the VC won't warn the unused local variables.

            The build does not fail on warnings. It is runtime error tells you that variable is used and its value was read. It makes sense to find out why it was so.

            wlad Vladislav Vaintroub added a comment - The build does not fail on warnings. It is runtime error tells you that variable is used and its value was read. It makes sense to find out why it was so.
            holyfoot Alexey Botchkov added a comment - - edited

            Ah, of course i meant to switch it off for the Release build only. Debug should still fail on the uninitialized variables.

            holyfoot Alexey Botchkov added a comment - - edited Ah, of course i meant to switch it off for the Release build only. Debug should still fail on the uninitialized variables.

            Runtime checks (/RTC flags in Visual C++) are never enabled in optimized builds, since they are very expensive in terms of peformance.
            They are enabled by default in debug builds
            https://msdn.microsoft.com/en-us/library/162azb0k.aspx

            I guess a better solution would be to treat corresponding warnings C4701 and C4703 as errors (using /we4701 /we4703 or #pragma warning (error : 4701)), so that compilation fails rather than program crashes at runtime. Visual C++ compiler is pretty accurate on such warnings, not known for many false positives

            wlad Vladislav Vaintroub added a comment - Runtime checks (/RTC flags in Visual C++) are never enabled in optimized builds, since they are very expensive in terms of peformance. They are enabled by default in debug builds https://msdn.microsoft.com/en-us/library/162azb0k.aspx I guess a better solution would be to treat corresponding warnings C4701 and C4703 as errors (using /we4701 /we4703 or #pragma warning (error : 4701)), so that compilation fails rather than program crashes at runtime. Visual C++ compiler is pretty accurate on such warnings, not known for many false positives

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.