[tarantool-patches] Re: [PATCH] Fix warnings

Alexander Turenko alexander.turenko at tarantool.org
Wed Apr 11 01:13:32 MSK 2018


Hi Gleb!

Please, remove set(CMAKE_C(XX)_FLAGS) from src/box/sql/CMakeLists.txt,
because it becomes redundant.

Travis-CI fails on your commit on say unit test. It seems it was fixed
in recent 2.0 branch, please rebase on 2.0 and make sure CI is passed.

The patch generally looks good for me except notes above and below.

Nikita, can you look into the patch?

On Wed, Apr 04, 2018 at 11:59:44AM +0300, Gleb wrote:

> Ensure -Werror -Wall set for the whole src/.
> Fix warnings which have been find with -Werror and -Wall.
> Add new building target RelWithDebInfoWError.
> Change building target on RelWithDebInfoWError in Ci.
> Fixes #3238

Separate 'Fixes #xxxx' with newline for readability.

Ci -> CI.

> index 05d33ab..6ec5f93 100644
> --- a/cmake/compiler.cmake
> +++ b/cmake/compiler.cmake
> @@ -251,12 +251,19 @@ macro(enable_tnt_compile_flags)
>      add_definitions("-D__STDC_LIMIT_MACROS=1")
>      add_definitions("-D__STDC_CONSTANT_MACROS=1")
>  
> -    # Only add -Werror if it's a debug build, done by developers.
> +    # Only add -Werror if it's a Debug or
> +    # RelWithDebInfoWError build, done by developers.
>      # Release builds should not cause extra trouble.
>      if ((${CMAKE_BUILD_TYPE} STREQUAL "Debug")
>          AND HAVE_STD_C11 AND HAVE_STD_CXX11)
>          add_compile_flags("C;CXX" "-Werror")
>      endif()
> +
> +    if ((${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfoWError")
> +        AND HAVE_STD_C11 AND HAVE_STD_CXX11)
> +        add_compile_flags("C;CXX" "-Werror")
> +        message("Trouble Release")
> +    endif()
>  endmacro(enable_tnt_compile_flags)

Please, remove the message.

> @@ -1040,13 +1040,15 @@ log_vsay(struct log *log, int level, const char *filename, int line,
>  		break;
>  	case SAY_LOGGER_SYSLOG:
>  		write_to_syslog(log, total);
> -		if (level == S_FATAL && log->fd != STDERR_FILENO)
> -			(void) write(STDERR_FILENO, buf, total);
> +		if (level == S_FATAL && log->fd != STDERR_FILENO) {
> +			ssize_t r = write(STDERR_FILENO, buf, total);
> +			(void) r;                       /* silence gcc warning */
> +		}
>  		break;

Replace 23 spaces before comment with one.

WBR, Alexander Turenko.




More information about the Tarantool-patches mailing list