mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-17 09:20:41 +01:00
module-template framework: avoid compiler warning in some legal cases
the finalize_it: label is required, but not always used, which each time results in a compiler warning that needs to be worked around. Now this is fixed once and for all for gcc and clang - the others will probably not complain in any case. Great solution until something comes up that makes us need a revision.
This commit is contained in:
parent
017a06e433
commit
a4c7f2ac81
@ -809,7 +809,6 @@ ENDnewActInst
|
||||
BEGINparseSelectorAct
|
||||
CODESTARTparseSelectorAct
|
||||
iRet = RS_RET_CONFLINE_UNPROCESSED;
|
||||
goto finalize_it; /* keep compiler happy (else we get "unused label" error) */
|
||||
CODE_STD_FINALIZERparseSelectorAct
|
||||
ENDparseSelectorAct
|
||||
|
||||
|
||||
@ -349,7 +349,7 @@ static rsRetVal parseSelectorAct(uchar **pp, void **ppModData, omodStringRequest
|
||||
CHKiRet(OMSRconstruct(ppOMSR, NumStrReqEntries));
|
||||
|
||||
#define CODE_STD_FINALIZERparseSelectorAct \
|
||||
finalize_it:\
|
||||
finalize_it: ATTR_UNUSED; /* semi-colon needed according to gcc doc! */\
|
||||
if(iRet == RS_RET_OK || iRet == RS_RET_OK_WARN || iRet == RS_RET_SUSPENDED) {\
|
||||
*ppModData = pData;\
|
||||
*pp = p;\
|
||||
|
||||
@ -51,6 +51,7 @@ extern int src_exists;
|
||||
#endif
|
||||
|
||||
#define ATTR_NORETURN __attribute__ ((noreturn))
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#define ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
|
||||
/* ############################################################# *
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user