diff --git a/regression/ansi-c/linking_conflicts1/test.desc b/regression/ansi-c/linking_conflicts1/test.desc index fb6ea7a29093..67ae329fc065 100644 --- a/regression/ansi-c/linking_conflicts1/test.desc +++ b/regression/ansi-c/linking_conflicts1/test.desc @@ -3,7 +3,7 @@ main.c other.c ^EXIT=(64|1)$ ^SIGNAL=0$ -error: conflicting function declarations 'bar' -error: conflicting function declarations 'bar2' +conflicting function declarations 'bar' +conflicting function declarations 'bar2' -- ^warning: ignoring diff --git a/regression/ansi-c/linking_conflicts2/test.desc b/regression/ansi-c/linking_conflicts2/test.desc index f579050c99b9..80197d8fdfc4 100644 --- a/regression/ansi-c/linking_conflicts2/test.desc +++ b/regression/ansi-c/linking_conflicts2/test.desc @@ -3,6 +3,6 @@ main.c other.c ^EXIT=(64|1)$ ^SIGNAL=0$ -error: conflicting function declarations 'foo' +conflicting function declarations 'foo' -- ^warning: ignoring diff --git a/src/ansi-c/c_typecheck_base.cpp b/src/ansi-c/c_typecheck_base.cpp index c9288a940c1a..bd5d805d0197 100644 --- a/src/ansi-c/c_typecheck_base.cpp +++ b/src/ansi-c/c_typecheck_base.cpp @@ -318,7 +318,7 @@ void c_typecheck_baset::typecheck_redefinition_non_type( if(final_old.id()!=ID_code) { error().source_location=new_symbol.location; - error() << "error: function symbol '" << new_symbol.display_name() + error() << "function symbol '" << new_symbol.display_name() << "' redefined with a different type:\n" << "Original: " << to_string(old_symbol.type) << "\n" << " New: " << to_string(new_symbol.type) << eom; @@ -613,9 +613,8 @@ void c_typecheck_baset::apply_asm_label( if(asm_label_map[orig_name]!=asm_label) { error().source_location=symbol.location; - error() << "error: replacing asm renaming " - << asm_label_map[orig_name] << " by " - << asm_label << eom; + error() << "replacing asm renaming " << asm_label_map[orig_name] + << " by " << asm_label << eom; throw 0; } } diff --git a/src/ansi-c/c_typecheck_code.cpp b/src/ansi-c/c_typecheck_code.cpp index 30e431fdef9e..a8634cc3a2fd 100644 --- a/src/ansi-c/c_typecheck_code.cpp +++ b/src/ansi-c/c_typecheck_code.cpp @@ -601,14 +601,6 @@ void c_typecheck_baset::typecheck_ifthenelse(code_ifthenelset &code) typecheck_expr(cond); - #if 0 - if(cond.id()==ID_sideeffect && - cond.get(ID_statement)==ID_assign) - { - warning("warning: assignment in if condition"); - } - #endif - implicit_typecast_bool(cond); if(code.then_case().get_statement() == ID_decl_block) diff --git a/src/ansi-c/c_typecheck_expr.cpp b/src/ansi-c/c_typecheck_expr.cpp index 022f5c4b4f93..c711dc21b1e5 100644 --- a/src/ansi-c/c_typecheck_expr.cpp +++ b/src/ansi-c/c_typecheck_expr.cpp @@ -1822,7 +1822,7 @@ void c_typecheck_baset::typecheck_expr_side_effect(side_effect_exprt &expr) if(type0.get_bool(ID_C_constant)) { error().source_location = op0.source_location(); - error() << "error: '" << to_string(op0) << "' is constant" << eom; + error() << "'" << to_string(op0) << "' is constant" << eom; throw 0; } diff --git a/src/ansi-c/c_typecheck_typecast.cpp b/src/ansi-c/c_typecheck_typecast.cpp index d0daeeec15ee..b66cd72f579b 100644 --- a/src/ansi-c/c_typecheck_typecast.cpp +++ b/src/ansi-c/c_typecheck_typecast.cpp @@ -34,7 +34,7 @@ void c_typecheck_baset::implicit_typecast( for(const auto &tc_warning : c_typecast.warnings) { warning().source_location=expr.find_source_location(); - warning() << "warning: conversion from '" << to_string(src_type) << "' to '" + warning() << "conversion from '" << to_string(src_type) << "' to '" << to_string(dest_type) << "': " << tc_warning << eom; } } diff --git a/src/cpp/cpp_declarator_converter.cpp b/src/cpp/cpp_declarator_converter.cpp index 48f8629e34b1..afb1424cfb42 100644 --- a/src/cpp/cpp_declarator_converter.cpp +++ b/src/cpp/cpp_declarator_converter.cpp @@ -174,8 +174,7 @@ symbolt &cpp_declarator_convertert::convert( if(symbol_expr.id() != ID_type) { cpp_typecheck.error().source_location=name.source_location(); - cpp_typecheck.error() << "error: expected type" - << messaget::eom; + cpp_typecheck.error() << "expected type" << messaget::eom; throw 0; } diff --git a/src/cpp/cpp_typecheck_bases.cpp b/src/cpp/cpp_typecheck_bases.cpp index 5992ef58c680..e53f8ef1a78b 100644 --- a/src/cpp/cpp_typecheck_bases.cpp +++ b/src/cpp/cpp_typecheck_bases.cpp @@ -131,7 +131,7 @@ void cpp_typecheckt::add_base_components( if(bases.find(from_name)!=bases.end()) { error().source_location=to.source_location(); - error() << "error: non-virtual base class " << from_name + error() << "non-virtual base class " << from_name << " inherited multiple times" << eom; throw 0; } diff --git a/src/cpp/cpp_typecheck_code.cpp b/src/cpp/cpp_typecheck_code.cpp index 1e35036ceb9b..a5589576e6f3 100644 --- a/src/cpp/cpp_typecheck_code.cpp +++ b/src/cpp/cpp_typecheck_code.cpp @@ -275,10 +275,10 @@ void cpp_typecheckt::typecheck_member_initializer(codet &code) if(access == ID_private || access == ID_noaccess) { #if 0 - error().source_location=code.source_location()); - str << "error: constructor of '" - << to_string(symbol_expr) - << "' is not accessible"; + error().source_location=code.find_source_location(); + error() << "constructor of '" + << to_string(symbol_expr) + << "' is not accessible" << eom; throw 0; #endif } diff --git a/src/cpp/cpp_typecheck_compound_type.cpp b/src/cpp/cpp_typecheck_compound_type.cpp index a601f9e6f7fd..ca90ef35f2f6 100644 --- a/src/cpp/cpp_typecheck_compound_type.cpp +++ b/src/cpp/cpp_typecheck_compound_type.cpp @@ -205,8 +205,7 @@ void cpp_typecheckt::typecheck_compound_type( else { error().source_location=type.source_location(); - error() << "error: compound tag '" << base_name - << "' declared previously\n" + error() << "compound tag '" << base_name << "' declared previously\n" << "location of previous definition: " << symbol.location << eom; throw 0; @@ -1518,9 +1517,8 @@ bool cpp_typecheckt::get_component( else { error().source_location=source_location; - error() << "error: member '" << component_name - << "' is not accessible (" << component.get(ID_access) << ")" - << eom; + error() << "member '" << component_name << "' is not accessible (" + << component.get(ID_access) << ")" << eom; throw 0; } } @@ -1554,8 +1552,8 @@ bool cpp_typecheckt::get_component( if(check_component_access(component, final_type)) { error().source_location=source_location; - error() << "error: member '" << component_name - << "' is not accessible" << eom; + error() << "member '" << component_name << "' is not accessible" + << eom; throw 0; } diff --git a/src/cpp/cpp_typecheck_enum_type.cpp b/src/cpp/cpp_typecheck_enum_type.cpp index 2baa954307aa..2133b204390e 100644 --- a/src/cpp/cpp_typecheck_enum_type.cpp +++ b/src/cpp/cpp_typecheck_enum_type.cpp @@ -135,8 +135,7 @@ void cpp_typecheckt::typecheck_enum_type(typet &type) if(has_body) { error().source_location=type.source_location(); - error() << "error: enum symbol '" << base_name - << "' declared previously\n" + error() << "enum symbol '" << base_name << "' declared previously\n" << "location of previous definition: " << symbol.location << eom; throw 0; } diff --git a/src/cpp/cpp_typecheck_expr.cpp b/src/cpp/cpp_typecheck_expr.cpp index 6048d129bdef..b42727b5de50 100644 --- a/src/cpp/cpp_typecheck_expr.cpp +++ b/src/cpp/cpp_typecheck_expr.cpp @@ -143,7 +143,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_lvalue_to_rvalue(e1, expr.op1())) { error().source_location=e1.find_source_location(); - error() << "error: lvalue to rvalue conversion" << eom; + error() << "lvalue to rvalue conversion" << eom; throw 0; } } @@ -154,7 +154,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_array_to_pointer(e1, expr.op1())) { error().source_location=e1.find_source_location(); - error() << "error: array to pointer conversion" << eom; + error() << "array to pointer conversion" << eom; throw 0; } } @@ -165,7 +165,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_function_to_pointer(e1, expr.op1())) { error().source_location=e1.find_source_location(); - error() << "error: function to pointer conversion" << eom; + error() << "function to pointer conversion" << eom; throw 0; } } @@ -176,7 +176,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_lvalue_to_rvalue(e2, expr.op2())) { error().source_location=e2.find_source_location(); - error() << "error: lvalue to rvalue conversion" << eom; + error() << "lvalue to rvalue conversion" << eom; throw 0; } } @@ -187,7 +187,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_array_to_pointer(e2, expr.op2())) { error().source_location=e2.find_source_location(); - error() << "error: array to pointer conversion" << eom; + error() << "array to pointer conversion" << eom; throw 0; } } @@ -198,7 +198,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) if(!standard_conversion_function_to_pointer(e2, expr.op2())) { error().source_location=expr.find_source_location(); - error() << "error: function to pointer conversion" << eom; + error() << "function to pointer conversion" << eom; throw 0; } } @@ -215,7 +215,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) else { error().source_location=expr.find_source_location(); - error() << "error: bad types for operands" << eom; + error() << "bad types for operands" << eom; throw 0; } return; @@ -268,7 +268,7 @@ void cpp_typecheckt::typecheck_expr_trinary(if_exprt &expr) else { error().source_location=expr.find_source_location(); - error() << "error: types are incompatible.\n" + error() << "types are incompatible.\n" << "I got '" << type2cpp(expr.op1().type(), *this) << "' and '" << type2cpp(expr.op2().type(), *this) << "'." << eom; throw 0; @@ -701,7 +701,7 @@ void cpp_typecheckt::typecheck_expr_address_of(exprt &expr) if(code_type.get_bool(ID_C_is_virtual)) { error().source_location=expr.source_location(); - error() << "error: pointers to virtual methods" + error() << "pointers to virtual methods" << " are currently not implemented" << eom; throw 0; } @@ -1062,7 +1062,7 @@ void cpp_typecheckt::typecheck_expr_member( if(expr.operands().size()!=1) { error().source_location=expr.find_source_location(); - error() << "error: member operator expects one operand" << eom; + error() << "member operator expects one operand" << eom; throw 0; } @@ -1094,7 +1094,7 @@ void cpp_typecheckt::typecheck_expr_member( followed_op0_type.id()!=ID_union) { error().source_location=expr.find_source_location(); - error() << "error: member operator requires struct/union type " + error() << "member operator requires struct/union type " << "on left hand side but got '" << to_string(followed_op0_type) << "'" << eom; throw 0; @@ -1106,7 +1106,7 @@ void cpp_typecheckt::typecheck_expr_member( if(type.is_incomplete()) { error().source_location = expr.find_source_location(); - error() << "error: member operator got incomplete type " + error() << "member operator got incomplete type " << "on left hand side" << eom; throw 0; } @@ -1153,7 +1153,7 @@ void cpp_typecheckt::typecheck_expr_member( to_code_type(symbol_expr.type()).return_type().id() == ID_constructor) { error().source_location=expr.find_source_location(); - error() << "error: member '" + error() << "member '" << lookup(symbol_expr.get(ID_identifier)).base_name << "' is a constructor" << eom; throw 0; @@ -1167,7 +1167,7 @@ void cpp_typecheckt::typecheck_expr_member( if(pcomp.is_nil()) { error().source_location=expr.find_source_location(); - error() << "error: '" << symbol_expr.get(ID_identifier) + error() << "'" << symbol_expr.get(ID_identifier) << "' is not static member " << "of class '" << to_string(op0.type()) << "'" << eom; throw 0; @@ -1209,8 +1209,8 @@ void cpp_typecheckt::typecheck_expr_member( else { error().source_location=expr.find_source_location(); - error() << "error: member '" << component_name << "' of '" - << to_string(type) << "' not found" << eom; + error() << "member '" << component_name << "' of '" << to_string(type) + << "' not found" << eom; throw 0; } @@ -1239,7 +1239,7 @@ void cpp_typecheckt::typecheck_expr_ptrmember( if(expr.operands().size()!=1) { error().source_location=expr.find_source_location(); - error() << "error: ptrmember operator expects one operand" << eom; + error() << "ptrmember operator expects one operand" << eom; throw 0; } @@ -1250,7 +1250,7 @@ void cpp_typecheckt::typecheck_expr_ptrmember( if(op.type().id() != ID_pointer) { error().source_location=expr.find_source_location(); - error() << "error: ptrmember operator requires pointer type " + error() << "ptrmember operator requires pointer type " << "on left hand side, but got '" << to_string(op.type()) << "'" << eom; throw 0; diff --git a/src/cpp/cpp_typecheck_resolve.cpp b/src/cpp/cpp_typecheck_resolve.cpp index 35d742e355ca..deacf8e70696 100644 --- a/src/cpp/cpp_typecheck_resolve.cpp +++ b/src/cpp/cpp_typecheck_resolve.cpp @@ -1649,9 +1649,8 @@ exprt cpp_typecheck_resolvet::resolve( return nil_exprt(); cpp_typecheck.error().source_location=result.source_location()); - cpp_typecheck.str - << "error: member '" << result.get(ID_component_name) - << "' is not accessible"; + cpp_typecheck.error() << "member '" << result.get(ID_component_name) + << "' is not accessible" << messaget::eom; throw 0; #endif } @@ -1667,7 +1666,7 @@ exprt cpp_typecheck_resolvet::resolve( cpp_typecheck.error().source_location=source_location; cpp_typecheck.error() - << "error: expected expression, but got type '" + << "expected expression, but got type '" << cpp_typecheck.to_string(result.type()) << "'" << messaget::eom; throw 0; @@ -1683,7 +1682,7 @@ exprt cpp_typecheck_resolvet::resolve( cpp_typecheck.error().source_location=source_location; cpp_typecheck.error() - << "error: expected type, but got expression '" + << "expected type, but got expression '" << cpp_typecheck.to_string(result) << "'" << messaget::eom; throw 0; diff --git a/src/cpp/cpp_typecheck_type.cpp b/src/cpp/cpp_typecheck_type.cpp index 9c034a432f1b..9ad47f3fa783 100644 --- a/src/cpp/cpp_typecheck_type.cpp +++ b/src/cpp/cpp_typecheck_type.cpp @@ -59,7 +59,7 @@ void cpp_typecheckt::typecheck_type(typet &type) if(symbol_expr.id()!=ID_type) { error().source_location=type.source_location(); - error() << "error: expected type" << eom; + error() << "expected type" << eom; throw 0; } diff --git a/src/goto-programs/builtin_functions.cpp b/src/goto-programs/builtin_functions.cpp index 40e9bb0e1c9e..45db21457ef0 100644 --- a/src/goto-programs/builtin_functions.cpp +++ b/src/goto-programs/builtin_functions.cpp @@ -627,15 +627,15 @@ void goto_convertt::do_function_call_symbol( if(ns.lookup(identifier, symbol)) { error().source_location=function.find_source_location(); - error() << "error: function '" << identifier << "' not found" << eom; + error() << "function '" << identifier << "' not found" << eom; throw 0; } if(symbol->type.id()!=ID_code) { error().source_location=function.find_source_location(); - error() << "error: function '" << identifier - << "' type mismatch: expected code" << eom; + error() << "function '" << identifier << "' type mismatch: expected code" + << eom; throw 0; } diff --git a/src/linking/linking.cpp b/src/linking/linking.cpp index 9dea1f00b9f6..473c0eeac58f 100644 --- a/src/linking/linking.cpp +++ b/src/linking/linking.cpp @@ -385,8 +385,7 @@ void linkingt::link_error( { error().source_location=new_symbol.location; - error() << "error: " << msg << " '" << old_symbol.display_name() << "'" - << '\n'; + error() << msg << " '" << old_symbol.display_name() << "'" << '\n'; error() << "old definition in module '" << old_symbol.module << "' " << old_symbol.location << '\n' << type_to_string_verbose(old_symbol) << '\n'; @@ -402,8 +401,8 @@ void linkingt::link_warning( { warning().source_location=new_symbol.location; - warning() << "warning: " << msg << " " << quote_begin - << old_symbol.display_name() << quote_end << '\n'; + warning() << msg << " " << quote_begin << old_symbol.display_name() + << quote_end << '\n'; warning() << "old definition in module " << old_symbol.module << " " << old_symbol.location << '\n' << type_to_string_verbose(old_symbol) << '\n'; @@ -1058,7 +1057,7 @@ void linkingt::duplicate_object_symbol( { warning().source_location=new_symbol.location; - warning() << "warning: conflicting initializers for" + warning() << "conflicting initializers for" << " variable " << quote_begin << old_symbol.name << quote_end << '\n'; warning() << "using old value in module " << old_symbol.module << " "