Skip to content

Commit 4b9cc24

Browse files
committed
Replace use of ` in messages by quote_begin (and ' by quote_end)
This continues the work of #4875, but now using quote_begin/quote_end stream modifiers.
1 parent 20d78c5 commit 4b9cc24

File tree

11 files changed

+34
-23
lines changed

11 files changed

+34
-23
lines changed

jbmc/regression/jbmc/classpath-invalid/test_jar_warning.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Test
33
--classpath ./NotHere.jar
44
^EXIT=6$
55
^SIGNAL=0$
6-
Warning: failed to access JAR file `./NotHere.jar'
6+
Warning: failed to access JAR file './NotHere.jar'
77
Error: Could not find or load main class Test
88
--
99
--

jbmc/regression/jbmc/classpath-invalid/test_path_warning.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Test
33
--classpath `../../../../scripts/format_classpath.sh ./NotHere .`
44
^EXIT=0$
55
^SIGNAL=0$
6-
Warning: failed to access directory `./NotHere'
6+
Warning: failed to access directory './NotHere'
77
--
88
--
99
Note: 'java' does not emit such a warning.

jbmc/src/java_bytecode/java_class_loader_base.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void java_class_loader_baset::add_classpath_entry(
3434
}
3535
else
3636
{
37-
log.warning() << "Warning: failed to access JAR file `" << path << "'"
37+
log.warning() << "Warning: failed to access JAR file "
38+
<< messaget::quote_begin << path << messaget::quote_end
3839
<< messaget::eom;
3940
}
4041
}
@@ -47,7 +48,8 @@ void java_class_loader_baset::add_classpath_entry(
4748
}
4849
else
4950
{
50-
log.warning() << "Warning: failed to access directory `" << path << "'"
51+
log.warning() << "Warning: failed to access directory "
52+
<< messaget::quote_begin << path << messaget::quote_end
5153
<< messaget::eom;
5254
}
5355
}

regression/goto-cc-file-local/old-flag-name/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ final-link assertion-check old-flag
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7-
^The `--export-function-local-symbols` flag is deprecated. Please use `--export-file-local-symbols` instead.$
7+
^The '--export-function-local-symbols' flag is deprecated. Please use '--export-file-local-symbols' instead.$
88
--
99
^warning: ignoring
1010
^\*\*\*\* WARNING: no body for function

src/ansi-c/c_typecheck_base.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ void c_typecheck_baset::typecheck_symbol(symbolt &symbol)
7979
// versions of Visual Studio insist to use this in their C library, and
8080
// GCC just warns as well.
8181
warning().source_location = symbol.value.find_source_location();
82-
warning() << "'extern' symbol '" << new_name
83-
<< "' should not have an initializer" << eom;
82+
warning() << quote_begin << "extern" << quote_end << " symbol "
83+
<< quote_begin << new_name << quote_end
84+
<< " should not have an initializer " << eom;
8485
}
8586
}
8687
else if(!is_function && symbol.value.id()==ID_code)

src/ansi-c/c_typecheck_code.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ void c_typecheck_baset::typecheck_switch_case(code_switch_caset &code)
551551
if(!case_is_allowed)
552552
{
553553
error().source_location = code.source_location();
554-
error() << "did not expect `case' here" << eom;
554+
error() << "did not expect " << quote_begin << "case" << quote_end
555+
<< " here" << eom;
555556
throw 0;
556557
}
557558

@@ -568,7 +569,8 @@ void c_typecheck_baset::typecheck_gcc_switch_case_range(
568569
if(!case_is_allowed)
569570
{
570571
error().source_location = code.source_location();
571-
error() << "did not expect `case' here" << eom;
572+
error() << "did not expect " << quote_begin << "case" << quote_end
573+
<< " here" << eom;
572574
throw 0;
573575
}
574576

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ void c_typecheck_baset::typecheck_expr_operands(exprt &expr)
774774
if(s_it == symbol_table.symbols.end())
775775
{
776776
error().source_location = expr.source_location();
777-
error() << "failed to find bound symbol `" << identifier
778-
<< "' in symbol table" << eom;
777+
error() << "failed to find bound symbol " << quote_begin << identifier
778+
<< quote_end << " in symbol table" << eom;
779779
throw 0;
780780
}
781781

src/cpp/cpp_instantiate_template.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ const symbolt &cpp_typecheckt::instantiate_template(
486486
if(new_decl.member_spec().is_virtual())
487487
{
488488
error().source_location=new_decl.source_location();
489-
error() << "invalid use of `virtual' in template declaration"
490-
<< eom;
489+
error() << "invalid use of " << quote_begin << "virtual" << quote_end
490+
<< " in template declaration" << eom;
491491
throw 0;
492492
}
493493

src/cpp/cpp_typecheck_expr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,8 @@ void cpp_typecheckt::typecheck_expr_this(exprt &expr)
981981
if(cpp_scopes.current_scope().class_identifier.empty())
982982
{
983983
error().source_location=expr.find_source_location();
984-
error() << "`this' is not allowed here" << eom;
984+
error() << quote_begin << "this" << quote_end << " is not allowed here"
985+
<< eom;
985986
throw 0;
986987
}
987988

src/goto-cc/compile.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,12 @@ compilet::compilet(cmdlinet &_cmdline, message_handlert &mh, bool Werror)
662662

663663
if(cmdline.isset("export-function-local-symbols"))
664664
{
665-
log.warning()
666-
<< "The `--export-function-local-symbols` flag is deprecated. "
667-
"Please use `--export-file-local-symbols` instead."
668-
<< messaget::eom;
665+
log.warning() << "The " << messaget::quote_begin
666+
<< "--export-function-local-symbols" << messaget::quote_end
667+
<< " flag is deprecated. "
668+
"Please use "
669+
<< messaget::quote_begin << "--export-file-local-symbols"
670+
<< messaget::quote_end << " instead." << messaget::eom;
669671
}
670672
}
671673

0 commit comments

Comments
 (0)