|
|
Log in / Subscribe / Register

Improved error reporting for CPython 3.10—and beyond

Improved error reporting for CPython 3.10—and beyond

Posted May 26, 2022 11:50 UTC (Thu) by rsidd (subscriber, #2582)
In reply to: Improved error reporting for CPython 3.10—and beyond by willy
Parent article: Improved error reporting for CPython 3.10—and beyond

gcc 11.2 still thinks the error is in the main file. Perhaps fixed it in gcc12? I tried it with a one-line header include missing a semicolon. With gcc11

$ gcc -c test.c
test.c: In function ‘printhello’:
test.c:3:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
    3 | int main() {
      |            ^
test.c:6: error: expected ‘{’ at end of input
With clang
$ clang -c test.c
In file included from test.c:1:
./printhello.h:1:18: error: expected ';' after top level declarator
void printhello() 
                 ^
                 ;
1 error generated.
However, I tried a more complicated codebase, and I don't get pages of errors: it errors out right after it figures out there is no opening brace or semicolon after the function definition.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds