|
@@ -4849,8 +4849,10 @@ sub process {
|
|
|
$dstat !~ /^\(\{/ && # ({...
|
|
|
$ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
|
|
|
{
|
|
|
-
|
|
|
- if ($dstat =~ /;/) {
|
|
|
+ if ($dstat =~ /^\s*if\b/) {
|
|
|
+ ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE",
|
|
|
+ "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects\n" . "$herectx");
|
|
|
+ } elsif ($dstat =~ /;/) {
|
|
|
ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE",
|
|
|
"Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx");
|
|
|
} else {
|