https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84887
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egallager at gcc dot gnu.org --- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to David Malcolm from comment #0) > > However, as suggested e.g. by oridb on Reddit, it would be more readable to > talk about the previous logical unit, and emit: > > t.c: In function ‘test’: > t.c:3:12: error: expected ‘;’ after ‘42’ token > return 42 > ^ > ; > > or somesuch: e.g. should we highlight the preceding token as a secondary > range, which would give: > > t.c: In function ‘test’: > t.c:3:12: error: expected ‘;’ after ‘42’ token > return 42 > ~~^ > ; > > (I'm not sure either way) link to thread on reddit? (In reply to David Malcolm from comment #1) > User "jancsika" on Hacker News points out: > > [...] the output is visually confusing-- you have an arrow pointing one's > > eye to the missing semicolon, but the underlined referent token is > > two line breaks away from it. Underlining the preceding "i" would put > > the emphasized token and missing semi right next to each other. > > and I agree, presumably we should print either just: > > q.c:1:6: error: expected ‘;’ after ‘i’ > int i > ^ > > or: > > q.c:1:6: error: expected ‘;’ after ‘i’ > int i > ~^ link to thread on Hacker News?