Re: in search of squiggles

Project / Subsystem

gcc / gcc

Date

2026-07-25

Proposer

Lewis Hyatt <lhyatt@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Encoding range information directly in `location_t` saves space but is limited to simple cases.
  • Using ad-hoc locations with a lookup table allows for arbitrary ranges but adds a layer of indirection and memory overhead.

All attributes

project
gcc
subsystem
gcc
patch_id
discussion_id
CAA_5UQ7_bu97+pLbmqftjKtzfBY-YEw=w5pcD4GfTHB3Y785FQ@mail.gmail.com
source_type
public_inbox
title
Re: in search of squiggles
headline
in search of squiggles
tldr
Compiler diagnostic location information explained with references to libcpp header and example file.
proposer
Lewis Hyatt <lhyatt@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Encoding range information directly in `location_t` saves space but is limited to simple cases.
  • Using ad-hoc locations with a lookup table allows for arbitrary ranges but adds a layer of indirection and memory overhead.
series_id
series_role
standalone
series_parts
[]
tags
  • diagnostics
  • compiler
  • debugging
  • source location
bugzilla_url
date
2026-07-25T00:00:00.000Z

Re: in search of squiggles

Responding to a question about how the GCC diagnostic system highlights errors, a participant pointed to documentation within libcpp/include/line-map.h and libcpp/location-example.txt. These resources explain how location_t values encode range information, either directly in their lower bits for simple ranges or via an external lookup table for more complex ones, determining the extent of compiler-generated squiggles.