Skip to content

NRF52: rename the STRINGIFY macro to avoid compiler warnings #7329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ typedef struct
#endif // NRF_BALLOC_CONFIG_DEBUG_ENABLED

#if NRF_BALLOC_CONFIG_DEBUG_ENABLED
#define __NRF_BALLOC_ASSIGN_POOL_NAME(_name) .p_name = STRINGIFY(_name),
#define __NRF_BALLOC_ASSIGN_POOL_NAME(_name) .p_name = NRF_STRINGIFY(_name),
#define __NRF_BALLOC_ASSIGN_DEBUG_FLAGS(_debug_flags) .debug_flags = (_debug_flags),
#else
#define __NRF_BALLOC_ASSIGN_DEBUG_FLAGS(_debug_flags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ uint32_t nrf_log_push(char * const p_str);
#define NRF_LOG_MODULE_REGISTER() \
NRF_SECTION_ITEM_REGISTER(NRF_LOG_CONST_SECTION_NAME(NRF_LOG_MODULE_NAME), \
_CONST nrf_log_module_const_data_t NRF_LOG_MODULE_DATA_CONST) = { \
.p_module_name = STRINGIFY(NRF_LOG_MODULE_NAME), \
.p_module_name = NRF_STRINGIFY(NRF_LOG_MODULE_NAME), \
.info_color_id = NRF_LOG_INFO_COLOR, \
.debug_color_id = NRF_LOG_DEBUG_COLOR, \
.compiled_lvl = COMPILED_LOG_LEVEL, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern "C" {
#define NRF_SECTION_START_ADDR(section_name) &CONCAT_2(__start_, section_name)

#elif defined(__ICCARM__)
#define NRF_SECTION_START_ADDR(section_name) __section_begin(STRINGIFY(section_name))
#define NRF_SECTION_START_ADDR(section_name) __section_begin(NRF_STRINGIFY(section_name))
#endif


Expand All @@ -89,7 +89,7 @@ extern "C" {
#define NRF_SECTION_END_ADDR(section_name) &CONCAT_2(__stop_, section_name)

#elif defined(__ICCARM__)
#define NRF_SECTION_END_ADDR(section_name) __section_end(STRINGIFY(section_name))
#define NRF_SECTION_END_ADDR(section_name) __section_end(NRF_STRINGIFY(section_name))
#endif


Expand Down Expand Up @@ -123,7 +123,7 @@ extern "C" {

#elif defined(__ICCARM__)
#define NRF_SECTION_DEF(section_name, data_type) \
_Pragma(STRINGIFY(section = STRINGIFY(section_name)));
_Pragma(NRF_STRINGIFY(section = NRF_STRINGIFY(section_name)));

#endif

Expand All @@ -142,15 +142,15 @@ extern "C" {
*/
#if defined(__CC_ARM)
#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \
section_var __attribute__ ((section(STRINGIFY(section_name)))) __attribute__((used))
section_var __attribute__ ((section(NRF_STRINGIFY(section_name)))) __attribute__((used))

#elif defined(__GNUC__)
#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \
section_var __attribute__ ((section("." STRINGIFY(section_name)))) __attribute__((used))
section_var __attribute__ ((section("." NRF_STRINGIFY(section_name)))) __attribute__((used))

#elif defined(__ICCARM__)
#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \
__root section_var @ STRINGIFY(section_name)
__root section_var @ NRF_STRINGIFY(section_name)
#endif


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ extern "C" {
/** Auxiliary macro used by @ref CONCAT_3 */
#define CONCAT_3_(p1, p2, p3) p1##p2##p3

#define STRINGIFY_(val) #val
#define NRF_STRINGIFY_(val) #val
/** Converts a macro argument into a character constant.
*/
#define STRINGIFY(val) STRINGIFY_(val)
#define NRF_STRINGIFY(val) NRF_STRINGIFY_(val)

/** Counts number of elements inside the array
*/
Expand Down