[MDEV-7435] Windows debug: Run-Time Check Failure #3 - The variable 'unused' is being used without being initialized Created: 2015-01-12 Updated: 2015-02-08 Resolved: 2015-02-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, Platform Windows |
| Affects Version/s: | 5.5, 10.0 |
| Fix Version/s: | 5.5.42, 10.0.16 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Elena Stepanova | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Windows, buildbot, compile | ||
| Issue Links: |
|
||||||||
| Description |
|
http://buildbot.askmonty.org/buildbot/builders/win32-debug2/builds/6784/steps/build/logs/stdio
Started happening from this revision:
|
| Comments |
| Comment by Sergey Vojtovich [ 2015-01-12 ] | ||||||||
|
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. | ||||||||
| Comment by Elena Stepanova [ 2015-02-05 ] | ||||||||
|
The problem was already fixed in 10.0.16 by the revision below; but on 5.5 the build still fails.
| ||||||||
| Comment by Alexey Botchkov [ 2015-02-06 ] | ||||||||
|
Same fix pushed to the 5.5. | ||||||||
| Comment by Vladislav Vaintroub [ 2015-02-08 ] | ||||||||
|
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. | ||||||||
| Comment by Alexey Botchkov [ 2015-02-08 ] | ||||||||
|
Ah, of course i meant to switch it off for the Release build only. Debug should still fail on the uninitialized variables. | ||||||||
| Comment by Vladislav Vaintroub [ 2015-02-08 ] | ||||||||
|
Runtime checks (/RTC flags in Visual C++) are never enabled in optimized builds, since they are very expensive in terms of peformance. 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 |