LWN: Comments on "GCC 10.1 Released" https://lwn.net/Articles/819793/ This is a special feed containing comments posted to the individual LWN article titled "GCC 10.1 Released". en-us Mon, 15 Sep 2025 23:35:05 +0000 Mon, 15 Sep 2025 23:35:05 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net GCC 10.1 Released https://lwn.net/Articles/827192/ https://lwn.net/Articles/827192/ flussence <div class="FormattedComment"> That would be nice to see. The GPL was written for a US audience, I&#x27;d imagine EU law sucks less for the little people.<br> </div> Tue, 28 Jul 2020 08:30:23 +0000 GCC 10.1 Released https://lwn.net/Articles/826420/ https://lwn.net/Articles/826420/ Wol <div class="FormattedComment"> I&#x27;m not sure you&#x27;re right there.<br> <p> If I can claim your actions have damaged me, I have a claim against you. If the GPL says you have to give me a copy of the source, certainly under - I think it&#x27;s now called the Consumer Rights Act (used to be Sale of Goods and Services) - I could sue you for providing faulty/incomplete goods. And if I was damaged by them I can go for damages, never mind that the goods were free. The GPL&#x27;s disclaimer of warranty wouldn&#x27;t apply because the suit would say you had forgone the GPL therefore weren&#x27;t protected by it...<br> <p> Not sure how well that would fly, but I think it would stand a good chance.<br> <p> Cheers,<br> Wol<br> </div> Sat, 18 Jul 2020 11:10:22 +0000 GCC 10.1 Released https://lwn.net/Articles/826419/ https://lwn.net/Articles/826419/ flussence <div class="FormattedComment"> Quoth the GPL:<br> <p> <font class="QuotedText">&gt; For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.</font><br> <p> OpenWRT is a whole OS-building SDK unto itself: a cross-compiler is bundled with it, is not a typical component found in a host OS, and cannot be trivially replaced (not least due to the fact that it&#x27;s a heavily patched copy of GCC).<br> </div> Sat, 18 Jul 2020 10:58:31 +0000 GCC 10.1 Released https://lwn.net/Articles/825975/ https://lwn.net/Articles/825975/ immibis <div class="FormattedComment"> Why would they need to give you the compiler?<br> </div> Mon, 13 Jul 2020 13:04:10 +0000 GCC 10.1 Released https://lwn.net/Articles/820676/ https://lwn.net/Articles/820676/ mathstuf <div class="FormattedComment"> <font class="QuotedText">&gt; they actually open sourced their gcc-based Objective-C compiler in 90-s</font><br> <p> Wasn't that under threat of lawsuit though? I wouldn't call that willful compliance.<br> </div> Fri, 15 May 2020 21:04:11 +0000 GCC 10.1 Released https://lwn.net/Articles/820675/ https://lwn.net/Articles/820675/ Cyberax <div class="FormattedComment"> <font class="QuotedText">&gt; I woundt say "no problems". More like it was mostly bearable and 3 was unbearable enough to warrant rewriting.</font><br> Well, it's a different way of saying it. But Apple really was OK with GPLv2, they actually open sourced their gcc-based Objective-C compiler in 90-s. I think it was esr who convinced them to do that?<br> <p> <font class="QuotedText">&gt; I wouldn't put much stock in their opinions of the GPL.</font><br> The problem is, Apple is not unique in their approach to GPLv3. It's explicitly banned in all large companies that I've worked in so far.<br> </div> Fri, 15 May 2020 20:58:49 +0000 GCC 10.1 Released https://lwn.net/Articles/820668/ https://lwn.net/Articles/820668/ mathstuf <div class="FormattedComment"> I woundt say "no problems". More like it was mostly bearable and 3 was unbearable enough to warrant rewriting. Either way, with how generally hostile Apple is to free software and developers anyways, I wouldn't put much stock in their opinions of the GPL.<br> </div> Fri, 15 May 2020 20:28:15 +0000 GCC 10.1 Released https://lwn.net/Articles/820589/ https://lwn.net/Articles/820589/ songmaster <div class="FormattedComment"> <font class="QuotedText">&gt; software patents have pretty much been killed by SCOTUS now.</font><br> <p> Sadly that doesn’t seem to have happened, the US patent office wrote some guidance for its examiners that effectively contradicted the SCOTUS Alice ruling and it’s now back to giving out stupid patents again. See this Techdirt article [1] for more details.<br> <p> [1] <a href="https://www.techdirt.com/articles/20200423/15295144360/us-patent-office-supreme-court-made-us-reject-more-patents-weve-now-fixed-that-are-back-to-approving-bad-patents.shtml">https://www.techdirt.com/articles/20200423/15295144360/us...</a><br> </div> Fri, 15 May 2020 02:59:26 +0000 GCC 10.1 Released https://lwn.net/Articles/820419/ https://lwn.net/Articles/820419/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; and in particular didn't have any language wrt patents.</font><br> <p> OMG NO!!!<br> <p> That is my beef with the GPL3 - patent language does not belong in a copyright licence!!! By all means stick a defensive clause in, but hopefully actually it's all moot now. I don't know the latest state of play, but I think software patents have pretty much been killed by SCOTUS now.<br> <p> <font class="QuotedText">&gt; wasn't really anything to do with copyleft vs permissive, but rather that the license itself was unclear</font><br> <p> and the defendant thought he could assume, BECAUSE the language was unclear, that the stuff was actually in the public domain. If you read the wiki article, it sounds like that's what he persuaded the court first time around, but the appeal court knocked that on the head. "If the conditions are unclear, it doesn't mean there are no conditions. It means the copyright holder has gone to the trouble of setting conditions and you must assume you need a licence".<br> <p> Cheers,<br> Wol<br> </div> Wed, 13 May 2020 15:41:06 +0000 GCC 10.1 Released https://lwn.net/Articles/820354/ https://lwn.net/Articles/820354/ joib <div class="FormattedComment"> I remember reading about the JMRI case here on lwn back when it happened. But IIRC the issue with the Artistic license JMRI used wasn't really anything to do with copyleft vs permissive, but rather that the license itself was unclear, and in particular didn't have any language wrt patents.<br> <p> There exists both copyleft and permissive licenses that don't suffer from these problems.<br> </div> Wed, 13 May 2020 09:32:07 +0000 GCC 10.1 Released https://lwn.net/Articles/820342/ https://lwn.net/Articles/820342/ ballombe <div class="FormattedComment"> Jeremy do not mention the reverse case where the FOSS developer is sued. In that case the GNU GPL can give you counterclaims,<br> see the JMRI case &lt;<a href="https://en.wikipedia.org/wiki/Jacobsen_v._Katzer">https://en.wikipedia.org/wiki/Jacobsen_v._Katzer</a>&gt;<br> </div> Tue, 12 May 2020 22:28:05 +0000 GCC 10.1 Released https://lwn.net/Articles/820205/ https://lwn.net/Articles/820205/ Cyberax <div class="FormattedComment"> Apple used LLVM for other purposes (famously for PDF rendering and OpenGL in the UI engine), so it's no wonder they were hiring LLVM developers. However, the work on clang started immediately after the first GPLv3 drafts were made public.<br> <p> And it's absolutely GPLv3. Apple has no problems shipping GPLv2, but they went as far as rewriting SMB implementation to avoid shipping Samba 3.<br> </div> Mon, 11 May 2020 16:00:46 +0000 GCC 10.1 Released https://lwn.net/Articles/820143/ https://lwn.net/Articles/820143/ mathstuf <div class="FormattedComment"> <font class="QuotedText">&gt; Aside: This is poor practice. You should serve a basic HTML page that works in any reasonable* browser, and then use JavaScript to progressively enable functionality that the current browser actually supports.</font><br> <p> I was more thinking about deciding to use whatever experimental HTTP headers browsers support these days more than serving up different code based on the user agent.<br> <p> Probably should have said "HTTP servers are" rather than "server-side-only is".<br> </div> Mon, 11 May 2020 14:38:00 +0000 GCC 10.1 Released https://lwn.net/Articles/820135/ https://lwn.net/Articles/820135/ anton Chris Lattner had already been <a href="https://web.archive.org/web/20111004073001/http://lists.trolltech.com/qt4-preview-feedback/2005-02/msg00691.html">hired by Apple in February 2005</a>. The first GPL v3 draft was published in January 2006, with the announcement of the work on GPL v3 in late 2005. <p>Apple did not want to comply with GPL v2 when they built the Objective-C front end for gcc (but eventually complied). Not really a sign that they are fine with GPLv2. Mon, 11 May 2020 11:42:17 +0000 GCC 10.1 Released https://lwn.net/Articles/820133/ https://lwn.net/Articles/820133/ oldtomas <div class="FormattedComment"> So there's still hope?<br> <p> I was under the impression that only a disruptive (possibly "external") event could derail this horror train. It just meshes too well with surveillance capitalism (and even worse "surveillance" things, with some perverse common interests).<br> <p> So thanks for shining some light of hope into an otherwise gray day :-)<br> </div> Mon, 11 May 2020 09:14:17 +0000 GCC 10.1 Released https://lwn.net/Articles/820126/ https://lwn.net/Articles/820126/ joib <div class="FormattedComment"> See also Jeremy Allison's presentation from the copyleft 2020 conference: <a rel="nofollow" href="https://lwn.net/Articles/818979/">https://lwn.net/Articles/818979/</a><br> <p> Considering jra was one of the authors of the GPLv3, and has relicensed some significant software to GPLv3, he being disillusioned with it, and with copyleft enforcement in general, might tell something.<br> <p> If, for the sake of argument, we take jra's arguments at face value, what are the implications? I suggest something like<br> <p> - Might as well choose a permissive license, to get the largest possible user base. That is, instead of viewing FOSS as a commons (see Ostrom), view it as a public good.<br> <p> - The four freedoms are as important as before, if not more. But if not copyleft enforcement, how to achieve it? a) jra's "documented and interoperable protocols" suggestion 2) Right to repair legislation? 3) Address the power imbalance between the citizens and internet giants (social media, cloud providers); Maybe view them as utilities subject to legislation like telecom and electricity?<br> <p> - Implement federated/distributed architectures that respect user freedom and privacy, and circumvent the scale advantages of the internet giants. So far things like FreedomBox and Mastodon haven't really been killer apps, but maybe there's something out there to be discovered?<br> <p> I have to admit this feels uncomfortable, as it relies to a large extent on "traditional" political activism. Which is uncomfortable for a nerd; we'd rather just write code and pretend that slapping on a copyleft license takes care of the political part.<br> </div> Mon, 11 May 2020 07:00:37 +0000 GCC 10.1 Released https://lwn.net/Articles/820127/ https://lwn.net/Articles/820127/ flussence <div class="FormattedComment"> The pendulum is now swinging back the other way, servers and browsers can negotiate supported features using only HTTP headers: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Client_hints">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers...</a><br> <p> There seems to be a gradual movement in web development back to inert content, following a collective realisation that doing everything in Javascript is a horrendous idea for performance, security and durability.<br> </div> Mon, 11 May 2020 06:38:18 +0000 GCC 10.1 Released https://lwn.net/Articles/820125/ https://lwn.net/Articles/820125/ flussence <div class="FormattedComment"> The GPL — which derives its clout from copyright law — only protects the author, and then only those that can afford legal action against copyright infringers. If an end user finds they're getting shafted by a company peddling routers/TVs/ARM SoCs, they can't do anything besides report it back to the copyright holder and hope action is taken.<br> </div> Mon, 11 May 2020 06:17:46 +0000 GCC 10.1 Released https://lwn.net/Articles/820124/ https://lwn.net/Articles/820124/ pabs <div class="FormattedComment"> If the router runs OpenWRT (and thus Linux) then it seems like you should be able to get the compiler and its sources.<br> </div> Mon, 11 May 2020 04:54:52 +0000 GCC 10.1 Released https://lwn.net/Articles/820122/ https://lwn.net/Articles/820122/ NYKevin <div class="FormattedComment"> <font class="QuotedText">&gt; (server-side-only is still stuck with user agent AFAIK)</font><br> <p> Aside: This is poor practice. You should serve a basic HTML page that works in any reasonable* browser, and then use JavaScript to progressively enable functionality that the current browser actually supports. That JavaScript should call into the server (if necessary) and pass information about the client (if necessary). At no point should the server be in a position of trying to guess a browser's capabilities based on HTTP headers alone, unless the client is not a browser and therefore not capable of executing JavaScript (at which point you are well off the beaten track and "best practices" are no longer a thing).<br> <p> This does mean that users with JavaScript disabled will get a less functional website than would otherwise be possible to provide (for example, it might lack modern CSS functionality and look uglier than strictly necessary). But those differences should be mostly presentational, and should not interfere with the core functionality of the website (unless you hate your users).<br> <p> * For whatever definition of "reasonable" your market research has led you to use. In practice, this is usually "Chrome plus some other ones," but whether that list includes IE, Opera, etc. may vary. A corporate intranet site has very different needs from google.com.<br> </div> Mon, 11 May 2020 02:35:35 +0000 GCC 10.1 Released https://lwn.net/Articles/820112/ https://lwn.net/Articles/820112/ mathstuf <div class="FormattedComment"> Except now, there is something called "JavaScript" which has access to real functionality and feature detection that you can do (server-side-only is still stuck with user agent AFAIK) provided the standards bodies bother providing such things. C and C++ only recently got more rigorous about adding things you can use to detect features like `__has_feature`, `__has_include`, and the myriad of feature test macros that now exist (though with C++20 modules, `__has_module` is an unaskable question due to the typical C++ compilation model). Unfortunately, the effective EOL horizon for compilers is much further away than the EOL horizon for browsers, so you *still* need all those old hacks (we have GCC 4.8 on target machines still :( ). Plus, that's only the stdlib. POSIX conformance bugs and kernel capabilities are still without consistent preprocessor detection and you're stuck with slow and wasteful configure checks.<br> </div> Sun, 10 May 2020 21:43:59 +0000 GCC 10.1 Released https://lwn.net/Articles/820108/ https://lwn.net/Articles/820108/ NYKevin <div class="FormattedComment"> So it's the UserAgent string all over again... and GCC is Mozilla/5.0.<br> </div> Sun, 10 May 2020 20:12:39 +0000 GCC 10.1 Released https://lwn.net/Articles/820093/ https://lwn.net/Articles/820093/ mathstuf <div class="FormattedComment"> <font class="QuotedText">&gt; Apparently Apple uses a time machine to fetch their branch</font><br> <p> No, this is because you have Xcode 11. Apple builds the Xcode toolchain off an internal branch of the repository and has a completely different versioning scheme (cf. the difference between the Clang and AppleClang compiler ids in CMake).<br> </div> Sun, 10 May 2020 13:46:05 +0000 GCC 10.1 Released https://lwn.net/Articles/820092/ https://lwn.net/Articles/820092/ mathstuf <div class="FormattedComment"> This is because so many C and C++ projects do compiler detection at some level. When building a new compiler, it is easiest to claim to be some other compiler to avoid falling into a myriad of "#error unknown compiler!" holes. Everyone claims GCC since it is prevalent and widely supported anyways. Nowadays, there are lots of frontends based on Clang, so __clang__ is in the same situation today.<br> <p> When detecting compilers, this is generally the detection order I'd suggest:<br> <p> - nvcc (because *sigh*)<br> - platform toolchains (xlc, acc, etc.)<br> - vendor toolchains (icc, msvc, etc.)<br> - clang<br> - gcc<br> - #error unknown (or #warning and assume GCC-alike)<br> <p> It is for this reason as well that GCC can't add a "I'm really GCC!" definition: other compilers would end up having to emulate *that* definition as well to get off the ground.<br> </div> Sun, 10 May 2020 13:44:30 +0000 GCC 10.1 Released https://lwn.net/Articles/820088/ https://lwn.net/Articles/820088/ mpr22 <div class="FormattedComment"> The GPL only protects people if they actually receive the covered software.<br> <p> If your router arrives without the compiler, then you have no standing to demand a copy of the source code for the compiler.<br> </div> Sun, 10 May 2020 13:24:21 +0000 GCC 10.1 Released https://lwn.net/Articles/820087/ https://lwn.net/Articles/820087/ Conan_Kudo This was probably the most painful GCC update that I've participated in a while. Almost all of my development time for Fedora 32 was spent fixing broken builds caused by this change in GCC. Not that I think it was a bad change, but I did not expect how much breakage it caused... Sun, 10 May 2020 13:09:59 +0000 GCC 10.1 Released https://lwn.net/Articles/820086/ https://lwn.net/Articles/820086/ zoobab <div class="FormattedComment"> "Let's be honest: Apple wanted clang to be a non-GPL gcc replacement."<br> <p> We are under the threat of a permissive license, which imply, for example, no obligation to release the source code of custom patches, which is pretty common in the embedded world.<br> <p> This will lead to the refusal from routers manufacturers (like the routers where you can run OpenWRT) to release the sources of their compiler.<br> </div> Sun, 10 May 2020 12:33:55 +0000 GCC 10.1 Released https://lwn.net/Articles/820083/ https://lwn.net/Articles/820083/ ballombe <div class="FormattedComment"> Apparently Apple ethos require then to ship XCode with a broken C compiler.<br> For a long time they shipped broken version of gcc, and now they ship broken version of clang.<br> I though that clang was a pile of cruft until I tried the Debian build and then suddenly it was<br> almost on par with gcc.<br> </div> Sun, 10 May 2020 09:16:36 +0000 GCC 10.1 Released https://lwn.net/Articles/820081/ https://lwn.net/Articles/820081/ felix.s Are you referring to the fact that <code>__has_builtin</code> returns 0 for those built-ins that are not functions, but keywords? Because that’s hardly ‘unusable’, especially that keywords can be tested for via <code>!__is_identifier</code>. Sun, 10 May 2020 08:20:06 +0000 GCC 10.1 Released https://lwn.net/Articles/820079/ https://lwn.net/Articles/820079/ ndesaulniers <div class="FormattedComment"> <font class="QuotedText">&gt; broken (or at least unusable) prior to clang 10.</font><br> <p> How's that?<br> </div> Sun, 10 May 2020 05:44:08 +0000 GCC 10.1 Released https://lwn.net/Articles/820063/ https://lwn.net/Articles/820063/ RedDwarf <div class="FormattedComment"> Yes. When I read it I though "OK, if I see any variable defined in a header I will need to put it in a source file, whatever". Then I don't remember what I was building and I found what I guess (at the end I didn't end up building it, didn't check in detail) was somebody forgetting to use static when defining a couple of file-scope variables with the same name... but it made me understand how horrible the "-fcommon" default was.<br> <p> Was that variable supposed to be shared by those two files or not?<br> Even if it was not intended to be shared, maybe the program is only working by accident and is going to break if I add the "static"s?<br> <p> I can't even imagine how much fun the Fedora packagers must have had with Fedora 32. I guess more than one must have started to simply add "-fcommon" to his packages CFLAGS out of desperation.<br> <p> </div> Sat, 09 May 2020 19:16:57 +0000 GCC 10.1 Released https://lwn.net/Articles/820041/ https://lwn.net/Articles/820041/ dtlin <div class="FormattedComment"> <a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html">https://pubs.opengroup.org/onlinepubs/9699919799/utilitie...</a><br> <p> Some options are specified.<br> </div> Sat, 09 May 2020 03:06:41 +0000 GCC 10.1 Released https://lwn.net/Articles/820037/ https://lwn.net/Articles/820037/ rahulsundaram <div class="FormattedComment"> I wrote the page originally but haven't updated that in years. Just did some minor tweaks now. It could definitely use a more comprehensive revamp. It is a wiki page so anyone interested, have at it.<br> </div> Sat, 09 May 2020 01:14:04 +0000 GCC 10.1 Released https://lwn.net/Articles/820035/ https://lwn.net/Articles/820035/ josh <div class="FormattedComment"> "contributor" would be accurate, but "lead maintainer" no longer is.<br> </div> Sat, 09 May 2020 00:35:41 +0000 GCC 10.1 Released https://lwn.net/Articles/820033/ https://lwn.net/Articles/820033/ wahern <p>It reports itself as 4.2.1. clang was designed to be compatible with GCC 4.2.1, with the notable exception of nested functions, and maybe a few other esoteric features. Intel C++ started defining __GNUC__, et al long before clang existed, so in practice __GNUC__ hasn't implied GCC for a long-time.</p> <p>What's more annoying is how Apple's build of clang reports itself. Apparently Apple uses a time machine to fetch their branch:</p> <pre> % cc -dM -E - &lt; /dev/null | grep clang #define __VERSION__ "4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.17)" #define __clang__ 1 #define __clang_major__ 11 #define __clang_minor__ 0 #define __clang_patchlevel__ 0 #define __clang_version__ "11.0.0 (clang-1100.0.33.17)" </pre> <p>clang 11 hasn't been released. In fact, clang 10 was just released about a month ago. Although, if you just accept that clang is effectively Apple's project--that Apple has veto power over anything they dislike, much like the FSF and Stallman with GCC--and not a completely independent open source project, then it's less objectionable, although no less confusing.</p> <p>clang did introduce useful feature test macros like __has_attribute, __has_extension, etc, which permit direct feature detection. But the most useful test macro, __has_builtin, is relatively recent--adopted by GCC 9, and broken (or at least unusable) prior to clang 10.</p> Fri, 08 May 2020 23:53:02 +0000 GCC 10.1 Released https://lwn.net/Articles/820031/ https://lwn.net/Articles/820031/ madscientist <div class="FormattedComment"> That's because so many of the system headers in glibc, etc. have special capabilities if you're using GCC. Since clang also supports those capabilities, it defines those macros as well.<br> <p> However, you _can_ tell the difference between the two compilers if you need to... one way is that GCC doesn't define any of the clang predefined macros like __clang__ etc.<br> </div> Fri, 08 May 2020 23:23:45 +0000 GCC 10.1 Released https://lwn.net/Articles/820030/ https://lwn.net/Articles/820030/ sorpigal I'm not surprised that C doesn't specify any CLI standard, just that POSIX doesn't. Some standard ought to, I think. Fri, 08 May 2020 23:03:55 +0000 GCC 10.1 Released https://lwn.net/Articles/820029/ https://lwn.net/Articles/820029/ atai <div class="FormattedComment"> lor clang even defines gcc's macro for compiler identification, kind of defeating the purpose of id'ing the compiler<br> </div> Fri, 08 May 2020 23:00:13 +0000 GCC 10.1 Released https://lwn.net/Articles/820022/ https://lwn.net/Articles/820022/ madscientist <div class="FormattedComment"> clang does take this too far in places unfortunately.<br> <p> One example: both GCC and clang support precompiled headers. However the format of the PCH files is very different, so that clang can't read GCC's file and vice versa. That's perfectly reasonable, and GCC creates PCH files suffixed with .gch and clang suffixes its PCH files with .pch.<br> <p> What's not so great is that clang ALSO tries to read files using GCC's extension .gch, and then fails (with a somewhat cryptic message) if it can't parse it (because it's a real GCC PCH file).<br> <p> This is a serious problem if you're trying to use both GCC and clang at the same time (for example, maybe you're using clangd for code inspection or similar but still build code with GCC).<br> <p> In this case the attempt to make it easy to switch from GCC to clang, by reusing the GCC filename, is certainly causing problems.<br> </div> Fri, 08 May 2020 20:46:01 +0000 GCC 10.1 Released https://lwn.net/Articles/820018/ https://lwn.net/Articles/820018/ ballombe <div class="FormattedComment"> Of course. gcc implements an extension of the standard options of POSIX cc.<br> This explain some awkwardness like -Wl, etc.<br> See &lt;<a href="https://pubs.opengroup.org/onlinepubs/7908799/xcu/cc.html">https://pubs.opengroup.org/onlinepubs/7908799/xcu/cc.html</a>&gt;<br> </div> Fri, 08 May 2020 20:33:38 +0000