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).
- debug_log_unused.patch 1.11KB
Comment #1
Posted on Oct 16, 2014 by Swift Oxaccepted 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