From 924b92765863cfedb1955c712cf12d1ec56d229b Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 4 Oct 2019 19:08:09 +0000 Subject: [preprocessor/91991] column location overflow https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00371.html PR preprocessor/91991 * line-map.c (linemap_line_start): Clear max_column_hint if we run out of locations. From-SVN: r276596 --- libcpp/ChangeLog | 6 ++++++ libcpp/line-map.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index e13ff1d..f3237fb 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2019-10-04 Nathan Sidwell + + PR preprocessor/91991 + * line-map.c (linemap_line_start): Clear max_column_hint if we run + out of locations. + 2019-10-02 Richard Biener * internal.h (enum include_type): Remove trailing comma. diff --git a/libcpp/line-map.c b/libcpp/line-map.c index d6924eb..feeb748 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -717,11 +717,11 @@ linemap_line_start (line_maps *set, linenum_type to_line, /* If the column number is ridiculous or we've allocated a huge number of location_ts, give up on column numbers (and on packed ranges). */ - max_column_hint = 0; + max_column_hint = 1; column_bits = 0; range_bits = 0; if (highest >= LINE_MAP_MAX_LOCATION) - return 0; + goto overflowed; } else { @@ -735,6 +735,7 @@ linemap_line_start (line_maps *set, linenum_type to_line, max_column_hint = 1U << column_bits; column_bits += range_bits; } + /* Allocate the new line_map. However, if the current map only has a single line we can sometimes just increase its column_bits instead. */ if (line_delta < 0 @@ -765,8 +766,11 @@ linemap_line_start (line_maps *set, linenum_type to_line, macro tokens. */ if (r >= LINE_MAP_MAX_LOCATION) { + overflowed: /* Remember we overflowed. */ set->highest_line = set->highest_location = LINE_MAP_MAX_LOCATION - 1; + /* No column numbers! */ + set->max_column_hint = 1; return 0; } -- cgit v1.1 From 175a85b29718141d73230ed19efcfcf963a0d0b6 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 11 Oct 2019 23:22:52 +0100 Subject: Support decimal floating-point constants in C2x. ISO C2x adds decimal floating point as an optional standard feature. This patch accordingly makes GCC accept DFP constants (DF, DD, DL, df, dd, dl suffixes) in strict C2X mode, with a pedwarn-if-pedantic for older standards and a warning with -Wc11-c2x-compat even in C2x mode (which in turn requires -Wc11-c2x-compat to be newly passed through to libcpp). Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/c-family: * c.opt (Wc11-c2x-compat): Add CPP(cpp_warn_c11_c2x_compat) CppReason(CPP_W_C11_C2X_COMPAT). gcc/testsuite: * gcc.dg/dfp/c11-constants-1.c, gcc.dg/dfp/c11-constants-2.c, gcc.dg/dfp/c2x-constants-1.c, gcc.dg/dfp/c2x-constants-2.c: New tests. * gcc.dg/dfp/constants-pedantic.c: Use -std=gnu17 explicitly. Update expected diagnostics. libcpp: * include/cpplib.h (struct cpp_options): Add dfp_constants and cpp_warn_c11_c2x_compat. (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT. * init.c (struct lang_flags): Add dfp_constants. (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and 0 for other languages. (cpp_set_lang): Set dfp_constants from language. (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1. * expr.c (interpret_float_suffix): Mention DFP constants as C2X in comment. (cpp_classify_number): Do not diagnose DFP constants for languages setting dfp_constants, unless cpp_warn_c11_c2x_compat. From-SVN: r276908 --- libcpp/ChangeLog | 15 +++++++++++++++ libcpp/expr.c | 17 ++++++++++++----- libcpp/include/cpplib.h | 7 +++++++ libcpp/init.c | 49 ++++++++++++++++++++++++++----------------------- 4 files changed, 60 insertions(+), 28 deletions(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index f3237fb..e8d2e48 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,18 @@ +2019-10-11 Joseph Myers + + * include/cpplib.h (struct cpp_options): Add dfp_constants and + cpp_warn_c11_c2x_compat. + (enum cpp_warning_reason): Add CPP_W_C11_C2X_COMPAT. + * init.c (struct lang_flags): Add dfp_constants. + (lang_defaults): Set dfp_constants to 1 for GNUC2X and STDC2X and + 0 for other languages. + (cpp_set_lang): Set dfp_constants from language. + (cpp_create_reader): Set cpp_warn_c11_c2x_compat to -1. + * expr.c (interpret_float_suffix): Mention DFP constants as C2X in + comment. + (cpp_classify_number): Do not diagnose DFP constants for languages + setting dfp_constants, unless cpp_warn_c11_c2x_compat. + 2019-10-04 Nathan Sidwell PR preprocessor/91991 diff --git a/libcpp/expr.c b/libcpp/expr.c index 4b514b1..65baafe 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -98,8 +98,8 @@ interpret_float_suffix (cpp_reader *pfile, const uchar *s, size_t len) flags = 0; f = d = l = w = q = i = fn = fnx = fn_bits = 0; - /* The following decimal float suffixes, from TR 24732:2009 and TS - 18661-2:2015, are supported: + /* The following decimal float suffixes, from TR 24732:2009, TS + 18661-2:2015 and C2X, are supported: df, DF - _Decimal32. dd, DD - _Decimal64. @@ -744,9 +744,16 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, "fixed-point constants are a GCC extension"); - if ((result & CPP_N_DFLOAT) && CPP_PEDANTIC (pfile)) - cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, - "decimal float constants are a GCC extension"); + if (result & CPP_N_DFLOAT) + { + if (CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, dfp_constants)) + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "decimal float constants are a C2X feature"); + else if (CPP_OPTION (pfile, cpp_warn_c11_c2x_compat) > 0) + cpp_warning_with_line (pfile, CPP_W_C11_C2X_COMPAT, + virtual_location, 0, + "decimal float constants are a C2X feature"); + } result |= CPP_N_FLOATING; } diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index ccbcfde..224369b 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -480,6 +480,9 @@ struct cpp_options /* Nonzero for C++ 2014 Standard digit separators. */ unsigned char digit_separators; + /* Nonzero for C2X decimal floating-point constants. */ + unsigned char dfp_constants; + /* Nonzero for C++2a __VA_OPT__ feature. */ unsigned char va_opt; @@ -508,6 +511,9 @@ struct cpp_options /* True if warn about differences between C90 and C99. */ signed char cpp_warn_c90_c99_compat; + /* True if warn about differences between C11 and C2X. */ + signed char cpp_warn_c11_c2x_compat; + /* True if warn about differences between C++98 and C++11. */ bool cpp_warn_cxx11_compat; @@ -607,6 +613,7 @@ enum cpp_warning_reason { CPP_W_DATE_TIME, CPP_W_PEDANTIC, CPP_W_C90_C99_COMPAT, + CPP_W_C11_C2X_COMPAT, CPP_W_CXX11_COMPAT, CPP_W_EXPANSION_TO_DEFINED }; diff --git a/libcpp/init.c b/libcpp/init.c index c932598..4bcec7b 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -93,32 +93,33 @@ struct lang_flags char utf8_char_literals; char va_opt; char scope; + char dfp_constants; }; static const struct lang_flags lang_defaults[] = -{ /* c99 c++ xnum xid c11 std digr ulit rlit udlit bincst digsep trig u8chlit vaopt scope*/ - /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1 }, - /* GNUC99 */ { 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1 }, - /* GNUC11 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1 }, - /* GNUC17 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1 }, - /* GNUC2X */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1 }, - /* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC94 */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC99 */ { 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC11 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC17 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1 }, - /* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1 }, - /* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1 }, - /* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1 }, - /* CXX11 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1 }, - /* GNUCXX14 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1 }, - /* CXX14 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 }, - /* GNUCXX17 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 }, - /* CXX17 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1 }, - /* GNUCXX2A */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 }, - /* CXX2A */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 }, - /* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +{ /* c99 c++ xnum xid c11 std digr ulit rlit udlit bincst digsep trig u8chlit vaopt scope dfp */ + /* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 }, + /* GNUC99 */ { 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0 }, + /* GNUC11 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0 }, + /* GNUC17 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0 }, + /* GNUC2X */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1 }, + /* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + /* STDC94 */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + /* STDC99 */ { 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + /* STDC11 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + /* STDC17 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1 }, + /* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 }, + /* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 }, + /* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0 }, + /* CXX11 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0 }, + /* GNUCXX14 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0 }, + /* CXX14 */ { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0 }, + /* GNUCXX17 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0 }, + /* CXX17 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 }, + /* GNUCXX2A */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0 }, + /* CXX2A */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0 }, + /* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; /* Sets internal flags correctly for a given language. */ @@ -145,6 +146,7 @@ cpp_set_lang (cpp_reader *pfile, enum c_lang lang) CPP_OPTION (pfile, utf8_char_literals) = l->utf8_char_literals; CPP_OPTION (pfile, va_opt) = l->va_opt; CPP_OPTION (pfile, scope) = l->scope; + CPP_OPTION (pfile, dfp_constants) = l->dfp_constants; } /* Initialize library global state. */ @@ -193,6 +195,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table, CPP_OPTION (pfile, warn_trigraphs) = 2; CPP_OPTION (pfile, warn_endif_labels) = 1; CPP_OPTION (pfile, cpp_warn_c90_c99_compat) = -1; + CPP_OPTION (pfile, cpp_warn_c11_c2x_compat) = -1; CPP_OPTION (pfile, cpp_warn_cxx11_compat) = 0; CPP_OPTION (pfile, cpp_warn_deprecated) = 1; CPP_OPTION (pfile, cpp_warn_long_long) = 0; -- cgit v1.1 From 9158f0ba97ff987948cd5ce8391a546751c6dff3 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 15 Oct 2019 12:03:04 +0000 Subject: [linemap PATCH] Constify lookup https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01080.html looking up a line map takes a non-constant line_maps object, which is confusing. This makes the caching fields mutable, so permits a constant object, as one might expect for a lookup. * include/line-map.h (struct maps_info_ordinary): Make cache mutable. (struct maps_info_macro): Likewise. (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor. (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise. (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use LINEMAPS_USED and LINEMAPS_MAP_AT. (linemap_lookup): Constify line_map arg. linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup): Constify line_map arg. From-SVN: r276994 --- libcpp/ChangeLog | 13 ++++++++++++ libcpp/include/line-map.h | 53 ++++++++++++----------------------------------- libcpp/line-map.c | 12 +++++------ 3 files changed, 32 insertions(+), 46 deletions(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index e8d2e48..670e97b 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,16 @@ +2019-10-15 Nathan Sidwell + + * include/line-map.h (struct maps_info_ordinary): Make cache + mutable. + (struct maps_info_macro): Likewise. + (LINEMAPS_CACHE): Remove non-ref accessor. Constify ref accessor. + (LINEMAPS_ORDINARY_CACHE, LINEMAPS_MACRO_CACHE): Likewise. + (LINEMAPS_ORDINARY_MAP_AT, LINEMAPS_MACRO_MAP_AT): Use + LINEMAPS_USED and LINEMAPS_MAP_AT. + (linemap_lookup): Constify line_map arg. + linemap.c (linemap_ordinary_map_lookup, linemap_macro_map_lookup): + Constify line_map arg. + 2019-10-11 Joseph Myers * include/cpplib.h (struct cpp_options): Add dfp_constants and diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index bde5e53..6f4cf5b 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -724,7 +724,7 @@ struct GTY(()) maps_info_ordinary { or equal to ALLOCATED. */ unsigned int used; - unsigned int cache; + mutable unsigned int cache; }; struct GTY(()) maps_info_macro { @@ -739,7 +739,7 @@ struct GTY(()) maps_info_macro { or equal to ALLOCATED. */ unsigned int used; - unsigned int cache; + mutable unsigned int cache; }; /* Data structure to associate a source_range together with an arbitrary @@ -865,19 +865,8 @@ LINEMAPS_USED (line_maps *set, bool map_kind) /* Returns the index of the last map that was looked up with linemap_lookup. MAP_KIND shall be TRUE if we are interested in macro maps, FALSE otherwise. */ -inline unsigned int -LINEMAPS_CACHE (const line_maps *set, bool map_kind) -{ - if (map_kind) - return set->info_macro.cache; - else - return set->info_ordinary.cache; -} - -/* As above, but by reference (e.g. as an lvalue). */ - inline unsigned int & -LINEMAPS_CACHE (line_maps *set, bool map_kind) +LINEMAPS_CACHE (const line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.cache; @@ -927,9 +916,9 @@ LINEMAPS_ORDINARY_MAPS (const line_maps *set) inline line_map_ordinary * LINEMAPS_ORDINARY_MAP_AT (const line_maps *set, int index) { - linemap_assert (index >= 0); - linemap_assert ((unsigned int)index < set->info_ordinary.used); - return &set->info_ordinary.maps[index]; + linemap_assert (index >= 0 + && (unsigned int)index < LINEMAPS_USED (set, false)); + return (line_map_ordinary *)LINEMAPS_MAP_AT (set, false, index); } /* Return the number of ordinary maps allocated in the line table @@ -949,16 +938,8 @@ LINEMAPS_ORDINARY_USED (const line_maps *set) /* Return the index of the last ordinary map that was looked up with linemap_lookup. */ -inline unsigned int -LINEMAPS_ORDINARY_CACHE (const line_maps *set) -{ - return LINEMAPS_CACHE (set, false); -} - -/* As above, but by reference (e.g. as an lvalue). */ - inline unsigned int & -LINEMAPS_ORDINARY_CACHE (line_maps *set) +LINEMAPS_ORDINARY_CACHE (const line_maps *set) { return LINEMAPS_CACHE (set, false); } @@ -991,9 +972,9 @@ LINEMAPS_MACRO_MAPS (const line_maps *set) inline line_map_macro * LINEMAPS_MACRO_MAP_AT (const line_maps *set, int index) { - linemap_assert (index >= 0); - linemap_assert ((unsigned int)index < set->info_macro.used); - return &set->info_macro.maps[index]; + linemap_assert (index >= 0 + && (unsigned int)index < LINEMAPS_USED (set, true)); + return (line_map_macro *)LINEMAPS_MAP_AT (set, true, index); } /* Returns the number of macro maps that were allocated in the line @@ -1011,18 +992,10 @@ LINEMAPS_MACRO_USED (const line_maps *set) return LINEMAPS_USED (set, true); } -/* Returns the index of the last macro map looked up with +/* Return the index of the last macro map that was looked up with linemap_lookup. */ -inline unsigned int -LINEMAPS_MACRO_CACHE (const line_maps *set) -{ - return LINEMAPS_CACHE (set, true); -} - -/* As above, but by reference (e.g. as an lvalue). */ - inline unsigned int & -LINEMAPS_MACRO_CACHE (line_maps *set) +LINEMAPS_MACRO_CACHE (const line_maps *set) { return LINEMAPS_CACHE (set, true); } @@ -1130,7 +1103,7 @@ extern const line_map *linemap_add binary search. If no line map have been allocated yet, this function returns NULL. */ extern const line_map *linemap_lookup - (class line_maps *, location_t); + (const line_maps *, location_t); /* Returns TRUE if the line table set tracks token locations across macro expansion, FALSE otherwise. */ diff --git a/libcpp/line-map.c b/libcpp/line-map.c index feeb748..b86a116 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -27,9 +27,9 @@ along with this program; see the file COPYING3. If not see #include "hashtab.h" static void trace_include (const line_maps *, const line_map_ordinary *); -static const line_map_ordinary * linemap_ordinary_map_lookup (line_maps *, +static const line_map_ordinary * linemap_ordinary_map_lookup (const line_maps *, location_t); -static const line_map_macro* linemap_macro_map_lookup (line_maps *, +static const line_map_macro* linemap_macro_map_lookup (const line_maps *, location_t); static location_t linemap_macro_map_loc_to_def_point (const line_map_macro *, location_t); @@ -937,7 +937,7 @@ linemap_position_for_loc_and_offset (line_maps *set, ordinary or a macro map), returns that map. */ const struct line_map* -linemap_lookup (line_maps *set, location_t line) +linemap_lookup (const line_maps *set, location_t line) { if (IS_ADHOC_LOC (line)) line = get_location_from_adhoc_loc (set, line); @@ -952,7 +952,7 @@ linemap_lookup (line_maps *set, location_t line) binary search. */ static const line_map_ordinary * -linemap_ordinary_map_lookup (line_maps *set, location_t line) +linemap_ordinary_map_lookup (const line_maps *set, location_t line) { unsigned int md, mn, mx; const line_map_ordinary *cached, *result; @@ -965,7 +965,7 @@ linemap_ordinary_map_lookup (line_maps *set, location_t line) mn = LINEMAPS_ORDINARY_CACHE (set); mx = LINEMAPS_ORDINARY_USED (set); - + cached = LINEMAPS_ORDINARY_MAP_AT (set, mn); /* We should get a segfault if no line_maps have been added yet. */ if (line >= MAP_START_LOCATION (cached)) @@ -1000,7 +1000,7 @@ linemap_ordinary_map_lookup (line_maps *set, location_t line) binary search. */ static const line_map_macro * -linemap_macro_map_lookup (line_maps *set, location_t line) +linemap_macro_map_lookup (const line_maps *set, location_t line) { unsigned int md, mn, mx; const struct line_map_macro *cached, *result; -- cgit v1.1