Saanch / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

Disabling debug/info output prevents compiling #424

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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).

Original issue reported on code.google.com by soul.cak...@gmail.com on 16 Oct 2014 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
accepted in r2901, thanks.

Original comment by matthias.ringwald@gmail.com on 16 Oct 2014 at 12:47

GoogleCodeExporter commented 9 years ago

Original comment by matthias.ringwald@gmail.com on 16 Oct 2014 at 12:47