aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorLewis Hyatt <lhyatt@gmail.com>2022-11-01 18:43:10 -0400
committerLewis Hyatt <lhyatt@gmail.com>2022-11-15 10:50:23 -0500
commit15d315553faafeac849522792b465e522c9d665b (patch)
treeb8764f475372f44fc50b07607ad3d5075e5f7c8e /gcc/c-family
parent6238cc20f0e588f272569230b33458fedf755ab2 (diff)
downloadgcc-15d315553faafeac849522792b465e522c9d665b.zip
gcc-15d315553faafeac849522792b465e522c9d665b.tar.gz
gcc-15d315553faafeac849522792b465e522c9d665b.tar.bz2
diagnostics: Use an inline function rather than hardcoding <built-in> string
The string "<built-in>" is hard-coded in several places throughout the diagnostics code, and in some of those places, it is used incorrectly with respect to internationalization. (Comparing a translated string to an untranslated string.) The error is not currently observable in any output GCC actually produces, hence no testcase added here, but it's worth fixing, and also, I am shortly going to add a new such string and want to avoid hardcoding that one in similar places. gcc/c-family/ChangeLog: * c-opts.cc (c_finish_options): Use special_fname_builtin () rather than a hard-coded string. gcc/ChangeLog: * diagnostic.cc (diagnostic_get_location_text): Use special_fname_builtin () rather than a hardcoded string (which was also incorrectly left untranslated previously.) * input.cc (special_fname_builtin): New function. (expand_location_1): Use special_fname_builtin () rather than a hard-coded string. (test_builtins): Likewise. * input.h (special_fname_builtin): Declare. gcc/fortran/ChangeLog: * cpp.cc (gfc_cpp_init): Use special_fname_builtin () rather than a hardcoded string (which was also incorrectly left untranslated previously.) * error.cc (gfc_diagnostic_build_locus_prefix): Likewise. * f95-lang.cc (gfc_init): Likewise.
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/c-opts.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
index 9e0494b..bc1f85e 100644
--- a/gcc/c-family/c-opts.cc
+++ b/gcc/c-family/c-opts.cc
@@ -1473,7 +1473,7 @@ c_finish_options (void)
{
const line_map_ordinary *bltin_map
= linemap_check_ordinary (linemap_add (line_table, LC_RENAME, 0,
- _("<built-in>"), 0));
+ special_fname_builtin (), 0));
cb_file_change (parse_in, bltin_map);
linemap_line_start (line_table, 0, 1);