Commit bb11eb82 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-6305 - UNINIT_VAR emits code in non-debug builds

Reverted workaround for gcc bug, which was fixed 3 years ago:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772
parent 378878e1
...@@ -55,7 +55,7 @@ ENDIF() ...@@ -55,7 +55,7 @@ ENDIF()
# Always enable -Wall for gnu C/C++ # Always enable -Wall for gnu C/C++
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_FLAGS MATCHES ".*-Wall.*") IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") SET(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter -Wno-init-self")
ENDIF() ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_FLAGS MATCHES ".*-Wall.*") IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS} -Wall") SET(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS} -Wall")
......
...@@ -480,16 +480,14 @@ extern "C" int madvise(void *addr, size_t len, int behav); ...@@ -480,16 +480,14 @@ extern "C" int madvise(void *addr, size_t len, int behav);
/* /*
Suppress uninitialized variable warning without generating code. Suppress uninitialized variable warning without generating code.
The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/ */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \ #if defined(__GNUC__)
defined(__cplusplus) || !defined(__GNUC__)
#define UNINIT_VAR(x) x= 0
#else
/* GCC specific self-initialization which inhibits the warning. */ /* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x #define UNINIT_VAR(x) x= x
#elif defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define UNINIT_VAR(x) x= 0
#else
#define UNINIT_VAR(x) x
#endif #endif
#if !defined(HAVE_UINT) #if !defined(HAVE_UINT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment