Export to GitHub

btstack - issue #424

Disabling debug/info output prevents compiling


Posted on Oct 16, 2014 by Helpful Rabbit

What steps will reproduce the problem? 1. Undefine ENABLE_LOG_DEBUG and/or ENABLE_LOG_INFO in btstack-config.h 2. Build for POSIX daemon target

What is the expected output? What do you see instead? Build fails with unused variable errors.

What version of the product are you using? On what operating system? Compiling with gcc 4.8.3 on Linux.

When ENABLE_LOG_xxx isn't defined, then the log_xxx macros do nothing with their arguments. gcc detects that the arguments are unused, and the compile fails because -Wunused -Werror are in effect.

The attached patch defines a vararg function, __log_unused, which is a no-op. It is not used on embedded systems (to make sure that no string tables get compiled in by accident).

Attachments

Comment #1

Posted on Oct 16, 2014 by Swift Ox

accepted in r2901, thanks.

Comment #2

Posted on Oct 16, 2014 by Swift Ox

(No comment was entered for this change.)

Status: Fixed

Labels:
Type-Defect Priority-Medium