anthropics / anthropics/claudes-c-compiler

A... couple... of type checking bugs

Offen
#57 4 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2.8k
Forks
247
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I considered doing separate issues for these but I'm assuming there's some common root cause.
```c
int g() {}
int main(void)
{
int arr[1] = {NULL, 3, "lol"[arr]};
struct { int x, y, z; } s = { "oops", arr, &s, 42 };
union { int i; float f; } u;
int x = u + s;
s = g;
return &s;
}
```
Compiler is awake and sees the problem immediately.
```
% ./target/release/ccc -o a /tmp/a.c
/tmp/a.c:2:1: warning: control reaches end of non-void function [-Wreturn-type]
int g() {}
^~~
```
100% would recommend, much more exciting to use than GCC!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.