Skip to content
Permalink
Browse files

shell: Fix checks of Kconfig options

The compiler was generating errors of the form
error: "CONFIG_LOG" is not defined, evaluates to 0 [-Werror=undef]
when -Wundef is used and the config option was turned off.  Change
several #if checks to #ifdef.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
  • Loading branch information...
Bradley Bolen authored and andrewboie committed May 13, 2019
1 parent c0b3035 commit 3c0c1bfa8da7a6ab7ae00a430d2cd0de47728e9e
Showing with 3 additions and 3 deletions.
  1. +1 −1 include/shell/shell.h
  2. +1 −1 include/shell/shell_history.h
  3. +1 −1 include/shell/shell_log_backend.h
@@ -500,7 +500,7 @@ struct shell_stats {
u32_t log_lost_cnt; /*!< Lost log counter.*/
};

#if CONFIG_SHELL_STATS
#ifdef CONFIG_SHELL_STATS
#define SHELL_STATS_DEFINE(_name) static struct shell_stats _name##_stats
#define SHELL_STATS_PTR(_name) (&(_name##_stats))
#else
@@ -29,7 +29,7 @@ struct shell_history_item {
char data[];
};

#if CONFIG_SHELL_HISTORY
#ifdef CONFIG_SHELL_HISTORY
#define SHELL_HISTORY_DEFINE(_name, block_size, block_count) \
\
K_MEM_SLAB_DEFINE(_name##_history_memslab, \
@@ -64,7 +64,7 @@ int shell_log_backend_output_func(u8_t *data, size_t length, void *ctx);
*
* @param _name Shell name.
*/
#if CONFIG_LOG
#ifdef CONFIG_LOG
#define SHELL_LOG_BACKEND_DEFINE(_name, _buf, _size, _queue_size, _timeout) \
LOG_BACKEND_DEFINE(_name##_backend, log_backend_shell_api, false); \
K_MSGQ_DEFINE(_name##_msgq, sizeof(struct shell_log_backend_msg), \

0 comments on commit 3c0c1bf

Please sign in to comment.
You can’t perform that action at this time.