Details
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.
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-6305 UNINIT_VAR emits code in non-debug builds
-
- Closed
-
- links to
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Sergei Golubchik, please review fix for this bug.