mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-26 16:53:30 +00:00
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses] (#374)
Except where the expansion would be syntactically invalid, for example "goto macroarg;" detection of which is a bug in clang-tidy, so warn it off with a NOLINT...(bugprone-macro-parentheses)
This commit is contained in:
24
src/dir.c
24
src/dir.c
@@ -77,14 +77,14 @@ extern int Dummy_errno;
|
||||
separate_version(tname, tver, 0); \
|
||||
\
|
||||
if ((pp = (char *)strrchr(tname, '.')) == NULL) { \
|
||||
*text = '\0'; \
|
||||
*(text) = '\0'; \
|
||||
} else { \
|
||||
*pp = '\0'; \
|
||||
strcpy(text, pp + 1); \
|
||||
} \
|
||||
\
|
||||
if ((pp = (char *)strrchr(pname, '.')) == NULL) { \
|
||||
*pext = '\0'; \
|
||||
*(pext) = '\0'; \
|
||||
} else { \
|
||||
*pp = '\0'; \
|
||||
strcpy(pext, pp + 1); \
|
||||
@@ -104,9 +104,9 @@ extern int Dummy_errno;
|
||||
SetupMatch(tname, pname, text, pext, tver); \
|
||||
\
|
||||
if (match_pattern(tname, pname) && match_pattern(text, pext) && match_pattern(tver, ver)) \
|
||||
goto matchtag; \
|
||||
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
else \
|
||||
goto unmatchtag; \
|
||||
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
}
|
||||
|
||||
#define MatchP_Case(target, name, ver, matchtag, unmatchtag) \
|
||||
@@ -120,9 +120,9 @@ extern int Dummy_errno;
|
||||
SetupMatch(tname, pname, text, pext, tver); \
|
||||
\
|
||||
if (match_pattern(tname, pname) && match_pattern(text, pext) && match_pattern(tver, ver)) \
|
||||
goto matchtag; \
|
||||
goto matchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
else \
|
||||
goto unmatchtag; \
|
||||
goto unmatchtag; /* NOLINT(bugprone-macro-parentheses) */ \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -292,13 +292,13 @@ int MAXFINFO;
|
||||
#define AllocFinfo(fp) \
|
||||
{ \
|
||||
if (FreeFinfoList != (FINFO *)NULL) { \
|
||||
fp = FreeFinfoList; \
|
||||
FreeFinfoList = fp->next; \
|
||||
} else if ((fp = (FINFO *)calloc(1, sizeof(FINFO))) == NULL) { \
|
||||
fp = (FINFO *)NULL; \
|
||||
} else if ((fp->prop = (FPROP *)calloc(1, sizeof(FPROP))) == NULL) { \
|
||||
(fp) = FreeFinfoList; \
|
||||
FreeFinfoList = (fp)->next; \
|
||||
} else if (((fp) = (FINFO *)calloc(1, sizeof(FINFO))) == NULL) { \
|
||||
(fp) = (FINFO *)NULL; \
|
||||
} else if (((fp)->prop = (FPROP *)calloc(1, sizeof(FPROP))) == NULL) { \
|
||||
free(fp); \
|
||||
fp = (FINFO *)NULL; \
|
||||
(fp) = (FINFO *)NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user