Skip to content

Commit 6a67ac6

Browse files
committed
Fix misleading identation inside macros
Addressing: /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c: In function ‘dbURIInfo_parse’: /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:186:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] while(0) ^ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:210:4: note: in expansion of macro ‘matchitem1’ matchitem1(tok, 's', ^~~~~~~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:211:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ "erver", info->host); break; ^~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:203:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] while(0) ^ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:212:4: note: in expansion of macro ‘matchitem2’ matchitem2(tok, 'p', ^~~~~~~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:214:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ "wd", info->pass); break; ^~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:186:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] while(0) ^ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:215:4: note: in expansion of macro ‘matchitem1’ matchitem1(tok, 'd', ^~~~~~~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:216:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ "atabase", info->db); break; ^~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:186:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] while(0) ^ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:217:4: note: in expansion of macro ‘matchitem1’ matchitem1(tok, 'u', ^~~~~~~~~~ /home/jcerny/openscap/src/OVAL/probes/independent/sql_probe.c:218:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ "id",info->user); break; ^~~~~
1 parent ef8d052 commit 6a67ac6

File tree

1 file changed

+6
-4
lines changed
  • src/OVAL/probes/independent

1 file changed

+6
-4
lines changed

src/OVAL/probes/independent/sql.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ static int dbURIInfo_parse(dbURIInfo_t *info, const char *conn)
186186
if (*(tok) != '=') goto __fail; \
187187
else (dst) = strdup((tok) + 1); \
188188
} \
189-
else dE("Unrecognized token: '%s'", (tok)-1); \
190-
while(0)
189+
else { \
190+
dE("Unrecognized token: '%s'", (tok)-1); \
191+
}
191192

192193
#define matchitem2(tok, first, rest1, dst1, rest2, dst2) \
193194
case first: \
@@ -203,8 +204,9 @@ static int dbURIInfo_parse(dbURIInfo_t *info, const char *conn)
203204
if (*(tok) != '=') goto __fail; \
204205
else (dst2) = strdup((tok) + 1); \
205206
} \
206-
else dE("Unrecognized token: '%s'", (tok)); \
207-
while(0)
207+
else { \
208+
dE("Unrecognized token: '%s'", (tok)); \
209+
}
208210

209211
tmp = NULL;
210212

0 commit comments

Comments
 (0)