mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-20819 Correct placement of parentheses in preprocessor macro.
The purpose of the FIELD_NAME_STR() macro is to create a string literal by using the # preprocessing operator and then skip the first 5 chars of this string by using the +5 pointer arithmetic. This is all intentional, but if the parentheses are misplaced the compiler might think that this is a mistake, a failed string concatenation (-Wstring-plus-int).
This commit is contained in:
parent
791980cf41
commit
e5529933b2
1 changed files with 1 additions and 1 deletions
|
@ -354,7 +354,7 @@ void CalendarTest::runIndexedTest( int32_t index, UBool exec, const char* &name,
|
|||
|
||||
UnicodeString CalendarTest::fieldName(UCalendarDateFields f) {
|
||||
switch (f) {
|
||||
#define FIELD_NAME_STR(x) case x: return (#x+5)
|
||||
#define FIELD_NAME_STR(x) case x: return (#x)+5
|
||||
FIELD_NAME_STR( UCAL_ERA );
|
||||
FIELD_NAME_STR( UCAL_YEAR );
|
||||
FIELD_NAME_STR( UCAL_MONTH );
|
||||
|
|
Loading…
Add table
Reference in a new issue