Skip to content

Commit 61f2410

Browse files
authored
Merge pull request #8333 from diffblue/verbosity-builtin-warning
increase verbosity of warning about missing `__builtin_` declaration
2 parents 6d92dca + c427d7b commit 61f2410

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,8 +2471,18 @@ void c_typecheck_baset::typecheck_side_effect_function_call(
24712471
symbolt *symbol_ptr;
24722472
move_symbol(new_symbol, symbol_ptr);
24732473

2474-
warning().source_location=f_op.find_source_location();
2475-
warning() << "function '" << identifier << "' is not declared" << eom;
2474+
// We increase the verbosity level of the warning
2475+
// for gcc/clang __builtin_ functions, since there are too many.
2476+
if(identifier.starts_with("__builtin_"))
2477+
{
2478+
debug().source_location = f_op.find_source_location();
2479+
debug() << "builtin '" << identifier << "' is unknown" << eom;
2480+
}
2481+
else
2482+
{
2483+
warning().source_location = f_op.find_source_location();
2484+
warning() << "function '" << identifier << "' is not declared" << eom;
2485+
}
24762486
}
24772487
}
24782488
}

0 commit comments

Comments
 (0)