Skip to content

Commit 9f81415

Browse files
WIP clang-format
1 parent 0f428b8 commit 9f81415

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

regression/cbmc/gcc_builtin_add_overflow/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void check_unsigned_long_long(void)
9292
assert(0 && "reachability");
9393
}
9494

95-
void check_generic(void) {
95+
void check_generic(void)
96+
{
9697
unsigned char small_result;
9798
signed long long big_result;
9899
assert(!__builtin_add_overflow(17, 25, &small_result));
@@ -104,7 +105,8 @@ void check_generic(void) {
104105
assert(big_result == 345);
105106
assert(!__builtin_add_overflow(INT_MAX, INT_MAX, &big_result));
106107
assert(big_result == 2ll * INT_MAX);
107-
assert(__builtin_add_overflow(LLONG_MAX/2+1, LLONG_MAX/2+1, &big_result));
108+
assert(
109+
__builtin_add_overflow(LLONG_MAX / 2 + 1, LLONG_MAX / 2 + 1, &big_result));
108110
assert(0 && "reachability");
109111
}
110112

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,20 +2808,17 @@ exprt c_typecheck_baset::do_special_functions(
28082808
identifier == "__builtin_sub_overflow" ||
28092809
identifier == "__builtin_mul_overflow")
28102810
{
2811-
if(expr.arguments().size() != 3) {
2811+
if(expr.arguments().size() != 3)
2812+
{
28122813
std::ostringstream error_message;
2813-
error_message
2814-
<< expr.source_location().as_string()
2815-
<< ": "
2816-
<< identifier
2817-
<< " takes exactly 3 arguments, but "
2818-
<< expr.arguments().size()
2819-
<< " were provided"
2820-
;
2814+
error_message << expr.source_location().as_string() << ": " << identifier
2815+
<< " takes exactly 3 arguments, but "
2816+
<< expr.arguments().size() << " were provided";
28212817
throw invalid_source_file_exceptiont{error_message.str()};
28222818
}
28232819

2824-
for(std::size_t arg_index = 0; arg_index < 3; ++arg_index) {
2820+
for(std::size_t arg_index = 0; arg_index < 3; ++arg_index)
2821+
{
28252822
auto const &argument = expr.arguments()[arg_index];
28262823
bool const arg_has_correct_type =
28272824
(arg_index < 2) ? (argument.type().id() == ID_signedbv ||

0 commit comments

Comments
 (0)