LWN: Comments on "Improved error reporting for CPython 3.10—and beyond" https://lwn.net/Articles/895587/ This is a special feed containing comments posted to the individual LWN article titled "Improved error reporting for CPython 3.10—and beyond". en-us Thu, 18 Sep 2025 23:44:15 +0000 Thu, 18 Sep 2025 23:44:15 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/898027/ https://lwn.net/Articles/898027/ nix <div class="FormattedComment"> <font class="QuotedText">&gt; I have never met a (not-Lisp) expansion language that I actually liked. I&#x27;m not sure why programmers keep trying to build them.</font><br> <p> For TeX it was simply because a typesetting language should have *typesetting text* as its primary purpose: so its primary input should be that text, not function calls or whatever. This more or less forces macro-expansion, or something like it, as a way to get anything but text in there. Ugly as sin, but there you are. :/<br> </div> Wed, 15 Jun 2022 17:14:58 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896424/ https://lwn.net/Articles/896424/ cozzyd <div class="FormattedComment"> It&#x27;s also easy to limit the number of errors printed in gcc. <br> </div> Fri, 27 May 2022 02:26:02 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896308/ https://lwn.net/Articles/896308/ bluss <div class="FormattedComment"> You could call it a &quot;feature&quot;. It&#x27;s a feature to be able to continue past an error and still do an effort to report further errors in the compilation. Sometimes this is even useful - if the errors are independent, you can read them and fix all in one turn of the edit-compile cycle. Unfortunately, if nonsensical knock-on errors are reported, then the end result is less useful.<br> <p> Rustc early in it development used to be really nice. It&#x27;s always been good at reporting clear error messages, and it&#x27;s still doing that well. Unfortunately during its development it&#x27;s also become a more advanced compiler, and is now very &quot;good&quot; at continuing to compile and report more errors. Again, this sometimes creates lots of nonsensical knock-on errors that are useless to the user. So Rustc grew up and joined GCC in this problem area.<br> <p> Of course we need to nudge beginners to learn to always look at the first error from the compiler, not the last one (the last one is usually the one remaining in view, unfortunately.)<br> </div> Thu, 26 May 2022 11:53:46 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896305/ https://lwn.net/Articles/896305/ rsidd 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 <pre> $ 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 </pre> With clang <pre> $ 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. </pre> 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. Thu, 26 May 2022 11:50:55 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896285/ https://lwn.net/Articles/896285/ rsidd <div class="FormattedComment"> Warnings (like overfull hbox) are not fatal, errors are, unless you like truncated output<br> </div> Thu, 26 May 2022 04:16:36 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896237/ https://lwn.net/Articles/896237/ willy <div class="FormattedComment"> I did persuade the GCC developers that they don&#x27;t need to continue to parse and emit syntax errors in the main file once there&#x27;s an error in a header file.<br> <p> But yes, GCC could be an awful lot better. The example I just hit was a missing function declaration, which happens to return a pointer. GCC emits two errors; the first for an implicit declaration and the second that we&#x27;re making a pointer from an integer (because the implicit declaration has return type int). The second warning isn&#x27;t useful.<br> <p> Easy reproducer:<br> void *f(void) { return g(); }<br> <p> A good language would infer the type that g() must return. C is not a good language.<br> </div> Wed, 25 May 2022 14:30:54 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896182/ https://lwn.net/Articles/896182/ MattBBaker <div class="FormattedComment"> On the other hand, with latex the errors are not necessary fatal. If the publisher will take it, latex and friends can emit all the exciting errors that they want<br> </div> Wed, 25 May 2022 11:59:04 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896180/ https://lwn.net/Articles/896180/ dottedmag <div class="FormattedComment"> <font class="QuotedText">&gt; I&#x27;m not sure why programmers keep trying to build them.</font><br> <p> Because it&#x27;s easy to build one.<br> <p> Bites you (or half of the planet) later on, but still it&#x27;s easy to build one.<br> <p> </div> Wed, 25 May 2022 09:20:35 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896172/ https://lwn.net/Articles/896172/ NYKevin <div class="FormattedComment"> In my experience, text-expansion (and token/macro-expansion) languages fall into two camps:<br> <p> * Lisp (and Lisp-likes): I have no experience with it, so I won&#x27;t state an opinion.<br> * Not-Lisp: Ranges from bad (e.g. the C preprocessor, bash string expansion) to godawful (e.g. C++ template metaprogramming). LaTeX is somewhere between those two extremes.<br> <p> I have never met a (not-Lisp) expansion language that I actually liked. I&#x27;m not sure why programmers keep trying to build them.<br> </div> Wed, 25 May 2022 04:55:11 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896171/ https://lwn.net/Articles/896171/ rsidd <div class="FormattedComment"> For most physics people I know, the much bigger struggle is with (La)TeX errors. Sometimes they make no sense at all. Python is a breeze in comparison and the particular error shown at the start here would have been flagged by a syntax-highlighting editor. <br> </div> Wed, 25 May 2022 04:34:41 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896162/ https://lwn.net/Articles/896162/ ballombe <div class="FormattedComment"> This is a gcc limitation. The compiler I used before gcc (so before 1994) did not do that, it would say &quot;semicolon expected&quot;. I remember because I was a C beginner then and made tons of syntax errors.<br> </div> Tue, 24 May 2022 22:06:03 +0000 Improved error reporting for CPython 3.10—and beyond https://lwn.net/Articles/896135/ https://lwn.net/Articles/896135/ abatters <div class="FormattedComment"> In C, the thing that always gets me:<br> <p> Forget to add the semicolon after a function prototype in a header file, and gcc spews pages and pages and pages of error messages. Multiplied by the number of parallel jobs in the Makefile.<br> <p> I just tried it. Deleted one semicolon after a prototype in a header file, ran make -j24, and got literally 185,000 lines of errors.<br> </div> Tue, 24 May 2022 16:12:16 +0000