[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/26781] New: ld: Suggest alternative spelling for "undefined refe
From: |
i at maskray dot me |
Subject: |
[Bug ld/26781] New: ld: Suggest alternative spelling for "undefined reference" diagnostics |
Date: |
Fri, 23 Oct 2020 22:43:19 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=26781
Bug ID: 26781
Summary: ld: Suggest alternative spelling for "undefined
reference" diagnostics
Product: binutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: i at maskray dot me
Target Milestone: ---
For an undefined symbol diagnostic, I have implemented the following corrector
for LLD, ordered in usefulness from high to low:
(a) There is a defined symbol with Levenshtein distance 1 or a transposition
https://reviews.llvm.org/D67039 This is probably good enough and it can suggest
some missing/superfluous qualifiers: const, restrict, volatile, & and &&
ref-qualifier, e.g.
error: undefined symbol: foo(int*)
>>> referenced by b.o:(.text+0x1)
+>>> did you mean: foo(int const*)
+>>> defined in: a.o
error: undefined symbol: foo(int*&)
>>> referenced by b.o:(.text+0x1)
+>>> did you mean: foo(int*)
+>>> defined in: b.o
(b) Case mismatch
ld.lld: error: undefined symbol: FOO(int const*)
>>> referenced by {{.*}}
>>> did you mean: foo(int const*)
(UpdateToGet -> UpdateToGET)
(c) Between the undefined symbol and the candidate, one is extern "C" and the
other is a raw C symbol.
ld.lld: error: undefined symbol: foo(int)
>>> referenced by {{.*}}
>>> did you mean: extern "C" foo
ld.lld: error: undefined symbol: foo
>>> referenced by {{.*}}
>>> did you mean to declare foo(int) as extern "C"?
--
You are receiving this mail because:
You are on the CC list for the bug.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug ld/26781] New: ld: Suggest alternative spelling for "undefined reference" diagnostics,
i at maskray dot me <=