[MDEV-6305] UNINIT_VAR emits code in non-debug builds Created: 2014-06-05 Updated: 2014-08-27 Resolved: 2014-08-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.37, 10.0.11, 10.1.0 |
| Fix Version/s: | 10.1.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sergey Vojtovich | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| 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 UNINIT_VAR() macro:
There are a few problems with this macro: It means leaving variable uninitialized makes sense only in C code compiled by gcc. Regarding __cplusplus: there is a reference to gcc bug which was fixed 3 years ago. Probably it is time to remove it? |
| Comments |
| Comment by Sergey Vojtovich [ 2014-06-24 ] | ||||||||
|
Sergei, please review fix for this bug. Though I doubt it is a good idea to "Always enable -Wall for gnu C/C++" bypassing cmake maintainer mode (specifically FORCE_INIT_OF_VARS). | ||||||||
| Comment by Sergei Golubchik [ 2014-08-25 ] | ||||||||
|
Ok to push. | ||||||||
| Comment by Sergey Vojtovich [ 2014-08-26 ] | ||||||||
|
Fixed in 10.1.1:
|