Thread View: comp.os.linux.misc
35 messages
35 total messages
Started by Leroy H
Sat, 31 Oct 2026 03:11
Substantive Comments Please: GCC vs. LLMV
Author: Leroy H
Date: Sat, 31 Oct 2026 03:11
Date: Sat, 31 Oct 2026 03:11
20 lines
1680 bytes
1680 bytes
I should have, but I have never seriously researched the differences and advantages/disadvantages of the GNU Compiler Collection (GCC) versus the LLVM/Clang compiler (only the C compiler interests me). All of my GNU/Linux systems are built using GCC. It has good hardware optimization options, Link Time Optimization (LTO), and even, if desired, Profile Guided Optimization (PGO). But LLVM/Clang has been around for a long while as an alternative C compiler. I have never used LLVM/Clang but others will claim benefits and advantages. To me, LLVM/Clang seems limited compared to GCC, especially in terms of SIMD hardware support, but that assessment is based on incomplete knowledge. Can anyone offer more insight into this issue? Basically, which compiler is truly "better?"
Re: Substantive Comments Please: GCC vs. LLMV
Author: Computer Nerd Kev
Date: Sat, 31 Oct 2026 07:28
Date: Sat, 31 Oct 2026 07:28
18 lines
1286 bytes
1286 bytes
Leroy H <lh@somewhere.net> wrote: > Can anyone offer more insight into this issue? > > Basically, which compiler is truly "better?" All I know is that libllvm is _huge_ and I've worked hard to avoid installing it on systems that I try to keep small. That sort of bloat really annoys me. According to these speed benchmarks of different libraries built with GCC and Clang, they're about evenly matched overall, but in some specific cases one can be significantly faster than the other: https://www.phoronix.com/review/gcc-16-vs-clang-22 -- __ __ #_ < |\| |< _#
Re: Substantive Comments Please: GCC vs. LLMV
Author: Leroy H
Date: Sat, 31 Oct 2026 13:25
Date: Sat, 31 Oct 2026 13:25
30 lines
1811 bytes
1811 bytes
On 31 Oct 2026 17:28:10 +1000, Computer Nerd Kev wrote: > > All I know is that libllvm is _huge_ and I've worked hard to avoid > installing it on systems that I try to keep small. That sort of > bloat really annoys me. > In some cases it cannot be avoided. One example is Mesa that uses llvm for software rendering: <https://docs.mesa3d.org/drivers/llvmpipe.html> Firefox releases are also built with llvm which means that Mozilla has chosen it over GCC: <https://www.phoronix.com/news/Firefox-Clang-LTO-All-Platforms> > > According to these speed benchmarks of different libraries built > with GCC and Clang, they're about evenly matched overall, but in > some specific cases one can be significantly faster than the other: > > https://www.phoronix.com/review/gcc-16-vs-clang-22 >
Re: Substantive Comments Please: GCC vs. LLMV
Author: jayjwa
Date: Sat, 31 Oct 2026 14:30
Date: Sat, 31 Oct 2026 14:30
31 lines
2376 bytes
2376 bytes
Leroy H <lh@somewhere.net> writes:
> I should have, but I have never seriously researched the differences
> and advantages/disadvantages of the GNU Compiler Collection (GCC)
> versus the LLVM/Clang compiler (only the C compiler interests me).
Clang whines alot on perfectly good code, but some of the graphics stuff
requires it. I think Mesa and also AMD ROCm. They have a special
LLVM/Clang needed for ROCm:
/opt/rocm/lib/llvm/bin/clang --version
AMD clang version 24.0.0git (https://github.com/ROCm/llvm-project.git d6f6cb691863e9258034ab48c1dfce21689d5606)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rocm/lib/llvm/bin
Configuration file: /opt/rocm/lib/llvm/bin/clang.cfg
If you're not building such things, you probably don't need it. I hear
the LLVM license is more permissive, though that doesn't affect me.
Rarely, I've had some things not build with GCC that did build with
Clang. With today's disk sizes, it's easy to keep both handy. I have a
very strong development environment here: between Linux and the virtual
machines hosts under it (and illumos), you'd have a hard time naming a
language I don't have access to. SNOBOL? Yeah, got that.
> Basically, which compiler is truly "better?"
Use case of course. But you knew that already.
--
PGP Key ID: 781C A3E2 C6ED 70A6 B356 7AF5 B510 542E D460 5CAE
"The Internet should always be the Wild West!"
Re: Substantive Comments Please: GCC vs. LLMV
Author: Leroy H
Date: Sat, 31 Oct 2026 15:12
Date: Sat, 31 Oct 2026 15:12
15 lines
1586 bytes
1586 bytes
On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: > > Rarely, I've had some things not build with GCC that did build with > Clang. With today's disk sizes, it's easy to keep both handy. > You also need a Rust compiler. More and more packages now require it. Librsvg, which I believe is the only SVG rendering library available for GNU/Linux, is just one example. No Rust, no SVG. Another C/C++ alternative would be the Intel icc compiler, which is now part of Intel OneAPI. The icc compiler was once quite superior to GCC but supposedly GCC has closed the gap over the years.
Re: Substantive Comments Please: GCC vs. LLMV
Author: rbowman
Date: Sat, 31 Oct 2026 19:21
Date: Sat, 31 Oct 2026 19:21
8 lines
1227 bytes
1227 bytes
On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: > If you're not building such things, you probably don't need it. I hear > the LLVM license is more permissive, though that doesn't affect me. It now uses the Apache 2.0 license as does Clang. Apple originally tried to use gcc with LLVM for Objective C. There were technical difficulties plus the GPL.
Re: GCC vs. LLVM
Author: Lawrence D’Oliveiro
Date: Sat, 31 Oct 2026 21:06
Date: Sat, 31 Oct 2026 21:06
8 lines
1499 bytes
1499 bytes
On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: > Clang whines alot on perfectly good code, but some of the graphics > stuff requires it. I think Mesa and also AMD ROCm. Why Clang and not GCC? Because those companies are afraid of the GPL, aren’t they?
Re: GCC vs. LLVM
Author: Nuno Silva
Date: Sun, 01 Nov 2026 00:39
Date: Sun, 01 Nov 2026 00:39
20 lines
1893 bytes
1893 bytes
On 2026-10-31, Lawrence D’Oliveiro wrote: > On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: > >> Clang whines alot on perfectly good code, but some of the graphics >> stuff requires it. I think Mesa and also AMD ROCm. > > Why Clang and not GCC? > > Because those companies are afraid of the GPL, aren’t they? Didn't a recent post to this group suggest Apple invested in clang+llvm because of absurd "fear" of GPLv3? Well, even if that was a driving factor, I welcome there being one more compiler collection. That kind of diversity is useful. Their long build times, on the other hand... -- Nuno Silva
Re: GCC vs. LLVM
Author: rbowman
Date: Sun, 01 Nov 2026 01:45
Date: Sun, 01 Nov 2026 01:45
22 lines
1733 bytes
1733 bytes
On Sun, 01 Nov 2026 00:39:59 +0000, Nuno Silva wrote: > On 2026-10-31, Lawrence D’Oliveiro wrote: > >> On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: >> >>> Clang whines alot on perfectly good code, but some of the graphics >>> stuff requires it. I think Mesa and also AMD ROCm. >> >> Why Clang and not GCC? >> >> Because those companies are afraid of the GPL, aren’t they? > > Didn't a recent post to this group suggest Apple invested in clang+llvm > because of absurd "fear" of GPLv3? I wouldn't call it fear. Apple initially attempted to use ggc as the front end to llvm. There was little interest in the gcc maintainers to support Objective C so Apple would have had to modify gcc, taking a big bite out of the poisoned apple. Which is more free, one of the many permissive licenses or GPLv3?
Re: GCC vs. LLVM
Author: c186282
Date: Sun, 01 Nov 2026 08:51
Date: Sun, 01 Nov 2026 08:51
31 lines
2707 bytes
2707 bytes
On 10/31/26 17:06, Lawrence D’Oliveiro wrote: > On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: > >> Clang whines alot on perfectly good code, but some of the graphics >> stuff requires it. I think Mesa and also AMD ROCm. > > Why Clang and not GCC? > > Because those companies are afraid of the GPL, aren’t they? IHMO - *both* GCC and Clang/LLVM are Very Good. No reason for any prejudice at this time. I tend to install 'em all by reflex. Code::Blocks can cope with them all. Also install 'TCC' - which is suprisingly good and creates more compact code more quickly - but don't expect the more 'esoteric' libraries. As for "whining" ... that seems to be a 'feature' of the modern compilers. They are SO tuned for "potential" issues that they pester you to death. Let 'em have their way and half yer code would be compiler flags and such turning off the 'whining'. Just write solid code and you'll be fine. It shouldn't BE this complicated ...... one reason I mostly switched to Python .... no whining. Python mostly IS 'C' ... all the libs are 'C' ... just interpreted steps between lib calls - a tad slower but much easier to deal with on many levels.
Re: GCC vs. LLVM
Author: Nuno Silva
Date: Sun, 01 Nov 2026 09:05
Date: Sun, 01 Nov 2026 09:05
35 lines
2418 bytes
2418 bytes
On 2026-11-01, rbowman wrote: > On Sun, 01 Nov 2026 00:39:59 +0000, Nuno Silva wrote: > >> On 2026-10-31, Lawrence D’Oliveiro wrote: >> >>> On Sat, 31 Oct 2026 10:30:39 -0400, jayjwa wrote: >>> >>>> Clang whines alot on perfectly good code, but some of the graphics >>>> stuff requires it. I think Mesa and also AMD ROCm. >>> >>> Why Clang and not GCC? >>> >>> Because those companies are afraid of the GPL, aren’t they? >> >> Didn't a recent post to this group suggest Apple invested in clang+llvm >> because of absurd "fear" of GPLv3? > > I wouldn't call it fear. Apple initially attempted to use ggc as the front > end to llvm. There was little interest in the gcc maintainers to support > Objective C so Apple would have had to modify gcc, taking a big bite out > of the poisoned apple. Ha! > Which is more free, one of the many permissive licenses or GPLv3? This would not be about GPL in general, but about the protections that were hardened specifically in GPLv3, so your question would be between GPLv2 and GPLv3. -- Nuno Silva
Re: GCC vs. LLVM
Author: Keith Thompson
Date: Sun, 01 Nov 2026 10:16
Date: Sun, 01 Nov 2026 10:16
12 lines
1705 bytes
1705 bytes
c186282 <c186282@nnada.net> writes:
[...]
> Also install 'TCC' - which
> is suprisingly good and creates more compact
> code more quickly - but don't expect the more
> 'esoteric' libraries.
Why would using tcc not give you access to "esoteric" libraries?
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: Substantive Comments Please: GCC vs. LLMV
Author: Chris Ahlstrom
Date: Sun, 01 Nov 2026 15:07
Date: Sun, 01 Nov 2026 15:07
36 lines
2878 bytes
2878 bytes
Leroy H wrote this screed in ALL-CAPS (fixed): > I should have, but I have never seriously researched the differences > and advantages/disadvantages of the GNU Compiler Collection (GCC) > versus the LLVM/Clang compiler (only the C compiler interests me). > > All of my GNU/Linux systems are built using GCC. It has good > hardware optimization options, Link Time Optimization (LTO), and > even, if desired, Profile Guided Optimization (PGO). > > But LLVM/Clang has been around for a long while as an alternative > C compiler. I have never used LLVM/Clang but others will claim > benefits and advantages. > > To me, LLVM/Clang seems limited compared to GCC, especially in terms > of SIMD hardware support, but that assessment is based on incomplete > knowledge. > > Can anyone offer more insight into this issue? > > Basically, which compiler is truly "better?" My recent projects are set up to use either one. Clang seems to be the "native" compiler on FreeBSD. GCC and Clang seem to me to be comparable and somewhat supporting the same options. Clang seems to increment versions more frequently. It finds some issues that g++ does not find, and g++ finds some issues that clang++ does not. They're roughly comparable in speed if cache is dropped between builds. As far as hardware support and C go, I have nothing to add. So sue me. -- I wasn't kissing her, I was whispering in her mouth. -- Chico Marx
Re: Substantive Comments Please: GCC vs. LLMV
Author: Nuno Silva
Date: Sun, 01 Nov 2026 18:31
Date: Sun, 01 Nov 2026 18:31
40 lines
2822 bytes
2822 bytes
On 2026-11-01, Chris Ahlstrom wrote: > Leroy H wrote this screed in ALL-CAPS (fixed): > >> I should have, but I have never seriously researched the differences >> and advantages/disadvantages of the GNU Compiler Collection (GCC) >> versus the LLVM/Clang compiler (only the C compiler interests me). >> >> All of my GNU/Linux systems are built using GCC. It has good >> hardware optimization options, Link Time Optimization (LTO), and >> even, if desired, Profile Guided Optimization (PGO). >> >> But LLVM/Clang has been around for a long while as an alternative >> C compiler. I have never used LLVM/Clang but others will claim >> benefits and advantages. >> >> To me, LLVM/Clang seems limited compared to GCC, especially in terms >> of SIMD hardware support, but that assessment is based on incomplete >> knowledge. >> >> Can anyone offer more insight into this issue? >> >> Basically, which compiler is truly "better?" > > My recent projects are set up to use either one. Clang seems to be > the "native" compiler on FreeBSD. GCC and Clang seem to me to be > comparable and somewhat supporting the same options. Clang seems > to increment versions more frequently. It finds some issues that > g++ does not find, and g++ finds some issues that clang++ does > not. They're roughly comparable in speed if cache is dropped > between builds. When you say "find issues" you mean merely in warning outputs or in differences owing to UB, or are you using their static analyzers? > As far as hardware support and C go, I have nothing to add. > So sue me. -- Nuno Silva
Re: GCC vs. LLVM
Author: c186282
Date: Sun, 01 Nov 2026 23:01
Date: Sun, 01 Nov 2026 23:01
16 lines
2126 bytes
2126 bytes
On 11/1/26 05:16, Keith Thompson wrote: > c186282 <c186282@nnada.net> writes: > [...] >> Also install 'TCC' - which >> is suprisingly good and creates more compact >> code more quickly - but don't expect the more >> 'esoteric' libraries. > > Why would using tcc not give you access to "esoteric" libraries? They don't come "in the package". You can always tweak and add-on later of course. Anyway, most tools center on GCC or Clang these days. Still use TCC sometimes if I'm writing a short utility however.
Re: GCC vs. LLVM
Author: Keith Thompson
Date: Mon, 02 Nov 2026 04:25
Date: Mon, 02 Nov 2026 04:25
36 lines
2852 bytes
2852 bytes
c186282 <c186282@nnada.net> writes:
> On 11/1/26 05:16, Keith Thompson wrote:
>> c186282 <c186282@nnada.net> writes:
>> [...]
>>> Also install 'TCC' - which
>>> is suprisingly good and creates more compact
>>> code more quickly - but don't expect the more
>>> 'esoteric' libraries.
>> Why would using tcc not give you access to "esoteric" libraries?
>
> They don't come "in the package". You can
> always tweak and add-on later of course.
> Anyway, most tools center on GCC or Clang
> these days. Still use TCC sometimes if I'm
> writing a short utility however.
(Why do you indent your original text in your posts? I find it
distracting.)
They typically don't come "in the package" with gcc either.
For Windows, gcc is typically installed via a package that includes
the compiler along with a number of libraries. In that context,
a tcc-based installer might not include the same libraries as a
gcc-based instaler.
For Linux-based and other Unix-like systems, it's more common
for libraries to be installed separately. For example, on my
Ubuntu system the "gcc" command is provided by the "gcc" package,
but the GNU MP bignum library is provided by the libgmp10 and
libgmp-dev packages. If I have a C program that depends on GNU
MP, I can build it with gcc, clang, or tcc.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: GCC vs. LLVM
Author: c186282
Date: Mon, 02 Nov 2026 06:52
Date: Mon, 02 Nov 2026 06:52
71 lines
4473 bytes
4473 bytes
On 11/1/26 23:25, Keith Thompson wrote: > c186282 <c186282@nnada.net> writes: >> On 11/1/26 05:16, Keith Thompson wrote: >>> c186282 <c186282@nnada.net> writes: >>> [...] >>>> Also install 'TCC' - which >>>> is suprisingly good and creates more compact >>>> code more quickly - but don't expect the more >>>> 'esoteric' libraries. >>> Why would using tcc not give you access to "esoteric" libraries? >> >> They don't come "in the package". You can >> always tweak and add-on later of course. >> Anyway, most tools center on GCC or Clang >> these days. Still use TCC sometimes if I'm >> writing a short utility however. > > (Why do you indent your original text in your posts? I find it > distracting.) That's "MY STYLE". Live with it. Keeps it more plain what others say, what I say. Also like 'random' capitalization and odd punctuation to kind-of emulate 'natural speaking'. You do it your way, I'll do it mine, and we'll all get there together. > They typically don't come "in the package" with gcc either. > > For Windows, gcc is typically installed via a package that includes > the compiler along with a number of libraries. In that context, > a tcc-based installer might not include the same libraries as a > gcc-based instaler. Correct. As per the 'tiny' bit, it's "cut down". Has MOST of what you'll need, good enough for a lot of stuff, but if you're doing "cutting edge" then go with the bigger compilers and their libs. > For Linux-based and other Unix-like systems, it's more common > for libraries to be installed separately. For example, on my > Ubuntu system the "gcc" command is provided by the "gcc" package, > but the GNU MP bignum library is provided by the libgmp10 and > libgmp-dev packages. If I have a C program that depends on GNU > MP, I can build it with gcc, clang, or tcc. Yea, it all gets bigger and deeper deeper deeper ... Does it HAVE to be thus ??? Just one of the reasons I mostly use Python these days ... "just works" ... though you still have to install libs. A "Python EVERYTHING" meta-package would be nice. Ah, was complaining about a re-install of a dedicated unit/app the other day, kept crashing after x-minutes. TWO things - it pings somewhere every so often to make sure it's still a good connection and ends the pgm if there's no response after x tries. The ping address is in a config file. First, had the wrong address in the config file. Second, it's actually FPING and I didn't install it :-) Details details ........ STILL not sure why @reboot didn't work OR a perfectly good systemd start-up. Last PiOS version I used those DID work.
Re: GCC vs. LLVM
Author: Keith Thompson
Date: Mon, 02 Nov 2026 07:06
Date: Mon, 02 Nov 2026 07:06
90 lines
5022 bytes
5022 bytes
c186282 <c186282@nnada.net> writes:
> On 11/1/26 23:25, Keith Thompson wrote:
>> c186282 <c186282@nnada.net> writes:
>>> On 11/1/26 05:16, Keith Thompson wrote:
>>>> c186282 <c186282@nnada.net> writes:
>>>> [...]
>>>>> Also install 'TCC' - which
>>>>> is suprisingly good and creates more compact
>>>>> code more quickly - but don't expect the more
>>>>> 'esoteric' libraries.
>>>> Why would using tcc not give you access to "esoteric" libraries?
>>>
>>> They don't come "in the package". You can
>>> always tweak and add-on later of course.
>>> Anyway, most tools center on GCC or Clang
>>> these days. Still use TCC sometimes if I'm
>>> writing a short utility however.
>> (Why do you indent your original text in your posts? I find it
>> distracting.)
>
> That's "MY STYLE". Live with it. Keeps it more
> plain what others say, what I say. Also like
> 'random' capitalization and odd punctuation
> to kind-of emulate 'natural speaking'. You do
> it your way, I'll do it mine, and we'll all
> get there together.
Of course I'll live with it. I might do so by ignoring you.
You can indicate that you posted something by identifying it
in the headers. If you think you're important enough to use a
different layout to tell us it's you, you're mistaken.
>> They typically don't come "in the package" with gcc either.
>> For Windows, gcc is typically installed via a package that includes
>> the compiler along with a number of libraries. In that context,
>> a tcc-based installer might not include the same libraries as a
>> gcc-based instaler.
>
> Correct. As per the 'tiny' bit, it's "cut down".
> Has MOST of what you'll need, good enough for a
> lot of stuff, but if you're doing "cutting edge"
> then go with the bigger compilers and their libs.
You seem to be ignoring the fact that compilers (gcc, clang, tcc)
are compilers, and do not include most libraries.
Perhaps you have an example of a library that you can use with gcc
and clang but can't use with tcc.
>> For Linux-based and other Unix-like systems, it's more common
>> for libraries to be installed separately. For example, on my
>> Ubuntu system the "gcc" command is provided by the "gcc" package,
>> but the GNU MP bignum library is provided by the libgmp10 and
>> libgmp-dev packages. If I have a C program that depends on GNU
>> MP, I can build it with gcc, clang, or tcc.
>
> Yea, it all gets bigger and deeper deeper deeper ...
>
> Does it HAVE to be thus ???
I have no idea what you mean. I've just told you that a library
can be used with any C compiler I like, and you seem to be saying
that's too complicated.
> Just one of the reasons I mostly use Python
> these days ... "just works" ... though you
> still have to install libs. A "Python EVERYTHING"
> meta-package would be nice.
>
> Ah, was complaining about a re-install of a
> dedicated unit/app the other day, kept crashing
> after x-minutes. TWO things - it pings somewhere
> every so often to make sure it's still a good
> connection and ends the pgm if there's no
> response after x tries. The ping address is
> in a config file. First, had the wrong address
> in the config file. Second, it's actually
> FPING and I didn't install it :-)
>
> Details details ........
But not enough details (like the name of the app) for anyone to
help you.
[...]
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: GCC vs. LLVM
Author: The Natural Philosopher
Date: Mon, 02 Nov 2026 10:39
Date: Mon, 02 Nov 2026 10:39
17 lines
2159 bytes
2159 bytes
On 02/11/2026 07:06, Keith Thompson wrote: > You can indicate that you posted something by identifying it in the > headers. If you think you're important enough to use a different > layout to tell us it's you, you're mistaken. > Thunderbird has a useful feature - rewrap. It can remove a lot of stylistic egotisms Sadly not CAPITALISATION... -- "I am inclined to tell the truth and dislike people who lie consistently. This makes me unfit for the company of people of a Left persuasion, and all women"
Re: GCC vs. LLVM
Author: c186282
Date: Mon, 02 Nov 2026 16:37
Date: Mon, 02 Nov 2026 16:37
17 lines
2356 bytes
2356 bytes
On 11/2/26 02:06, Keith Thompson wrote: > c186282 <c186282@nnada.net> writes: >> On 11/1/26 23:25, Keith Thompson wrote: >>> (Why do you indent your original text in your posts? I find it >>> distracting.) >> >> That's "MY STYLE". Live with it. Keeps it more >> plain what others say, what I say. Also like >> 'random' capitalization and odd punctuation >> to kind-of emulate 'natural speaking'. You do >> it your way, I'll do it mine, and we'll all >> get there together. > > Of course I'll live with it. I might do so by ignoring you. Just think of it as "Python Style" :-)
Re: Substantive Comments Please: GCC vs. LLMV
Author: Chris Ahlstrom
Date: Mon, 02 Nov 2026 16:54
Date: Mon, 02 Nov 2026 16:54
45 lines
3264 bytes
3264 bytes
Nuno Silva wrote this screed in ALL-CAPS (fixed): > On 2026-11-01, Chris Ahlstrom wrote: > >> Leroy H wrote this screed in ALL-CAPS (fixed): >> >>> I should have, but I have never seriously researched the differences >>> and advantages/disadvantages of the GNU Compiler Collection (GCC) >>> versus the LLVM/Clang compiler (only the C compiler interests me). >>> >>> All of my GNU/Linux systems are built using GCC. It has good >>> hardware optimization options, Link Time Optimization (LTO), and >>> even, if desired, Profile Guided Optimization (PGO). >>> >>> But LLVM/Clang has been around for a long while as an alternative >>> C compiler. I have never used LLVM/Clang but others will claim >>> benefits and advantages. >>> >>> To me, LLVM/Clang seems limited compared to GCC, especially in terms >>> of SIMD hardware support, but that assessment is based on incomplete >>> knowledge. >>> >>> Can anyone offer more insight into this issue? >>> >>> Basically, which compiler is truly "better?" >> >> My recent projects are set up to use either one. Clang seems to be >> the "native" compiler on FreeBSD. GCC and Clang seem to me to be >> comparable and somewhat supporting the same options. Clang seems >> to increment versions more frequently. It finds some issues that >> g++ does not find, and g++ finds some issues that clang++ does >> not. They're roughly comparable in speed if cache is dropped >> between builds. > > When you say "find issues" you mean merely in warning outputs or in > differences owing to UB, or are you using their static analyzers? Just looking at warnings. Using "ninja scan-build" just now to see what happens. -- BOFH excuse #62: Need to wrap system in aluminum foil to fix problem
Re: GCC vs. LLVM
Author: Charlie Gibbs
Date: Mon, 02 Nov 2026 16:54
Date: Mon, 02 Nov 2026 16:54
29 lines
2094 bytes
2094 bytes
On 2026-11-02, c186282 <c186282@nnada.net> wrote: > On 11/2/26 02:06, Keith Thompson wrote: > >> c186282 <c186282@nnada.net> writes: >> >>> On 11/1/26 23:25, Keith Thompson wrote: >>> >>>> (Why do you indent your original text in your posts? I find it >>>> distracting.) >>> >>> That's "MY STYLE". Live with it. Keeps it more >>> plain what others say, what I say. Also like >>> 'random' capitalization and odd punctuation >>> to kind-of emulate 'natural speaking'. You do >>> it your way, I'll do it mine, and we'll all >>> get there together. >> >> Of course I'll live with it. I might do so by ignoring you. > > Just think of it as "Python Style" :-) "I thought we were an autonomous collective." -- /~\ Charlie Gibbs | In this world there are \ / <cgibbs@kltpzyxm.invalid> | two kinds of people: X I'm really at ac.dekanfrus | 1. Those who can extrapolate / \ if you read it the right way. | from incomplete data.
Re: GCC vs. LLVM
Author: c186282
Date: Mon, 02 Nov 2026 16:57
Date: Mon, 02 Nov 2026 16:57
32 lines
2861 bytes
2861 bytes
On 11/2/26 02:06, Keith Thompson wrote: > c186282 <c186282@nnada.net> writes: >> Ah, was complaining about a re-install of a >> dedicated unit/app the other day, kept crashing >> after x-minutes. TWO things - it pings somewhere >> every so often to make sure it's still a good >> connection and ends the pgm if there's no >> response after x tries. The ping address is >> in a config file. First, had the wrong address >> in the config file. Second, it's actually >> FPING and I didn't install it :-) >> >> Details details ........ > > But not enough details (like the name of the app) for anyone to > help you. It's my hand-writ app, it could be named "DobbyElf" :-) Pi4. Creates a rotating display of security cams and weather info. Have a (near) clone in another room with better wifi. This is a 're-install' problem. You may document your code well but may not remember all the supporting utilities and more obscure system settings that made things work well before. Oh well, all fixed. Should work well for another couple of years.
Re: Substantive Comments Please: GCC vs. LLMV
Author: Chris Ahlstrom
Date: Mon, 02 Nov 2026 19:18
Date: Mon, 02 Nov 2026 19:18
36 lines
2698 bytes
2698 bytes
Chris Ahlstrom wrote this screed in ALL-CAPS (fixed):
> Nuno Silva wrote this screed in ALL-CAPS (fixed):
>
>> On 2026-11-01, Chris Ahlstrom wrote:
>>
>>> <snip>
>>>
>> When you say "find issues" you mean merely in warning outputs or in
>> differences owing to UB, or are you using their static analyzers?
>
> Just looking at warnings.
>
> Using "ninja scan-build" just now to see what happens.
It found a few issues in a couple of my projects, a few issues
important. There is one that I don't get
subprojects/libcfg66/src/util/filefunctions.cpp:1138:33:
warning: Memory allocated by 'new[]' should be deallocated by 'delete[]',
not 'getline()' [unix.MismatchedDeallocator]
1138 | ssize_t count { getline(&destination, &maxim, input) };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I guess I need to use malloc() instead.
--
Mummy dust to make me old;
To shroud my clothes, the black of night;
To age my voice, an old hag's cackle;
To whiten my hair, a scream of fright;
A blast of wind to fan my hate;
A thunderbolt to mix it well --
Now begin thy magic spell!
-- Walter Disney, "Snow White"
Re: Substantive Comments Please: GCC vs. LLMV
Author: rbowman
Date: Mon, 02 Nov 2026 20:17
Date: Mon, 02 Nov 2026 20:17
17 lines
1614 bytes
1614 bytes
On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
> It found a few issues in a couple of my projects, a few issues
> important.
> There is one that I don't get
>
> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
> Memory allocated by 'new[]' should be deallocated by 'delete[]',
> not 'getline()' [unix.MismatchedDeallocator]
>
> 1138 | ssize_t count { getline(&destination, &maxim, input) };
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> I guess I need to use malloc() instead.
Did you allocate destination with new? getline will malloc a buffer if you
pass in NULL.
Re: GCC vs. LLVM
Author: Carlos E. R.
Date: Mon, 02 Nov 2026 22:16
Date: Mon, 02 Nov 2026 22:16
21 lines
1742 bytes
1742 bytes
On 2026-11-02 07:52, c186282 wrote:
> On 11/1/26 23:25, Keith Thompson wrote:
>> (Why do you indent your original text in your posts? I find it
>> distracting.)
>
> That's "MY STYLE". Live with it. Keeps it more plain what others
> say, what I say. Also like 'random' capitalization and odd
> punctuation to kind-of emulate 'natural speaking'. You do it your
> way, I'll do it mine, and we'll all get there together.
Done. :-)
--
Cheers,
Carlos E.R.
ES🇪🇸, EU🇪🇺.
Re: GCC vs. LLVM
Author: Leroy H
Date: Mon, 02 Nov 2026 23:01
Date: Mon, 02 Nov 2026 23:01
19 lines
1582 bytes
1582 bytes
On Sun, 01 Nov 2026 20:25:35 -0800, Keith Thompson wrote: > > (Why do you indent your original text in your posts? I find it > distracting.) > Ha, ha, ha, ha, ha, ha! What a fucking fuddy-duddy! If this were an actual public, and not virtual, meeting place, people would be putting itching powder on your stuffy skin. <https://en.wikipedia.org/wiki/Itching_powder> You are an unbelievable, tasteless throwback. Ha, ha, ha, ha, ha, ha, ha, ha!
Re: GCC vs. LLVM
Author: c186282
Date: Tue, 03 Nov 2026 01:47
Date: Tue, 03 Nov 2026 01:47
23 lines
2555 bytes
2555 bytes
On 11/2/26 17:16, Carlos E. R. wrote: > On 2026-11-02 07:52, c186282 wrote: >> On 11/1/26 23:25, Keith Thompson wrote: > > >>> (Why do you indent your original text in your posts? I find it >>> distracting.) >> >> That's "MY STYLE". Live with it. Keeps it more plain what others >> say, what I say. Also like 'random' capitalization and odd >> punctuation to kind-of emulate 'natural speaking'. You do it your >> way, I'll do it mine, and we'll all get there together. > > Done. :-) Sounds good - I'm not out to troll/trash, just add my little bits to the overall equation. Know I'm not "superior", just have MY odd base of experience. Put everybody's "odd bases" together and ........ Just think of it as "PYTHON Style" ... indents ! :-)
Re: GCC vs. LLVM
Author: c186282
Date: Tue, 03 Nov 2026 02:03
Date: Tue, 03 Nov 2026 02:03
36 lines
2967 bytes
2967 bytes
On 11/2/26 18:01, Leroy H wrote: > On Sun, 01 Nov 2026 20:25:35 -0800, Keith Thompson wrote: > >> >> (Why do you indent your original text in your posts? I find it >> distracting.) >> > > Ha, ha, ha, ha, ha, ha! What a fucking fuddy-duddy! > > If this were an actual public, and not virtual, meeting > place, people would be putting itching powder on your > stuffy skin. > > <https://en.wikipedia.org/wiki/Itching_powder> > > You are an unbelievable, tasteless throwback. > > Ha, ha, ha, ha, ha, ha, ha, ha! Aww ... give him a break. The style - though old - is a bit odd. I think of it now as "Python Style", indents. DOES help make you/me stuff more obvious to the eye however. As said, we ALL have our quirks AND encyclopedia of experiences. Some ARE generally 'better' than others - but only a few of those are Superior Assholes dedicated to pissing on everyone else. If we all add our base of experiences - often stretching back 40-50 years - together more than one good fix for any particular issue can be found. SEEMS like the purpose of these groups.
Re: GCC vs. LLVM
Author: Leroy H
Date: Tue, 03 Nov 2026 02:44
Date: Tue, 03 Nov 2026 02:44
30 lines
2046 bytes
2046 bytes
On Mon, 2 Nov 2026 21:03:28 -0500, c186282 wrote: > On 11/2/26 18:01, Leroy H wrote: >> On Sun, 01 Nov 2026 20:25:35 -0800, Keith Thompson wrote: >> >>> >>> (Why do you indent your original text in your posts? I find it >>> distracting.) >>> >> >> You are an unbelievable, tasteless throwback. >> > > Aww ... give him a break. > No, no no, no. no, no. Anyone who actually is more impressed with meaningless formatting rather than message content is an inexcusable and infinite jerk. This jerk deserves to be forever ridiculed and ostracized for his idiotic attitude. His momma obviously made him tuck his bed sheets upon rising in the morning. The term "dickhead" was invented specifically for his pedantic type.
Re: Substantive Comments Please: GCC vs. LLMV
Author: Chris Ahlstrom
Date: Tue, 03 Nov 2026 13:22
Date: Tue, 03 Nov 2026 13:22
31 lines
2611 bytes
2611 bytes
rbowman wrote this screed in ALL-CAPS (fixed):
> On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
>
>> It found a few issues in a couple of my projects, a few issues
>> important.
>> There is one that I don't get
>>
>> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
>> Memory allocated by 'new[]' should be deallocated by 'delete[]',
>> not 'getline()' [unix.MismatchedDeallocator]
>>
>> 1138 | ssize_t count { getline(&destination, &maxim, input) };
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I guess I need to use malloc() instead.
>
> Did you allocate destination with new? getline will malloc a buffer if you
> pass in NULL.
Yes, and I know that from the man page.
The point is scan-build complaining about something getline() will
not do in the given use case.
A limitation of static analysis, perhaps.
--
<Stealth> How do I bind a computer to an NIS server?
<Joey> Use a rope?
-- Seen on #Debian
Re: Substantive Comments Please: GCC vs. LLMV
Author: Richard Kettlewell
Date: Tue, 03 Nov 2026 18:44
Date: Tue, 03 Nov 2026 18:44
54 lines
3617 bytes
3617 bytes
Chris Ahlstrom <OFeem1987@teleworm.us> writes:
> rbowman wrote this screed in ALL-CAPS (fixed):
>> On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
>>> It found a few issues in a couple of my projects, a few issues
>>> important.
>>> There is one that I don't get
>>>
>>> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
>>> Memory allocated by 'new[]' should be deallocated by 'delete[]',
>>> not 'getline()' [unix.MismatchedDeallocator]
>>>
>>> 1138 | ssize_t count { getline(&destination, &maxim, input) };
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> I guess I need to use malloc() instead.
>>
>> Did you allocate destination with new? getline will malloc a buffer
>> if you pass in NULL.
>
> Yes, and I know that from the man page.
>
> The point is scan-build complaining about something getline() will
> not do in the given use case.
>
> A limitation of static analysis, perhaps.
There’s not enough context to give a completely definitive answer, but:
1) Heap memory can be managed with new/delete, or with
malloc/realloc/free, but not both. The consequences of playing
mix-and-match vary between platform, so you might get away with it in
some cases, by luck, but static analysis tools will consider it a
bug, if they’re smart enough to notice.
2) In getline(), if *lineptr!=NULL then it will call realloc() on it if
the line from stream needs more than *n bytes (using argument names
from [1]). So passing a pointer allocated with new to it is a bug,
for the reasons given in (1) above.
3) The diagnostic referring to deallocation reather than realloc is
probably a (trivial) bug in the tool - for example it may model
realloc as malloc+free, which isn’t unreasonable as such, but leads
to an opaque diagnostic.
The only case where it would not be a bug is if the line read by
getline() can never possibly exceed the initial allocation. Whether this
is true in your use case I don’t know, but your static analysis tool
either couldn’t prove that it was or more likely, isn’t equipped to do
so.
[1] https://man7.org/linux/man-pages/man3/getline.3.html
--
https://www.greenend.org.uk/rjk/
Re: GCC vs. LLVM
Author: Rich
Date: Wed, 04 Nov 2026 03:58
Date: Wed, 04 Nov 2026 03:58
20 lines
2314 bytes
2314 bytes
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > c186282 <c186282@nnada.net> writes: >> Correct. As per the 'tiny' bit, it's "cut down". Has MOST of what >> you'll need, good enough for a lot of stuff, but if you're doing >> "cutting edge" then go with the bigger compilers and their libs. > > You seem to be ignoring the fact that compilers (gcc, clang, tcc) are > compilers, and do not include most libraries. SOL (Speed of Light) nym is our local human hallucinator. It hallucinates more wrong stuff than all the best LLM's put together, except unlike the AI's it "sticks to it's hallucinations" when called out. > Perhaps you have an example of a library that you can use with gcc > and clang but can't use with tcc. It will not be able to do so, because whatever point it is trying to make is very likely a hallucination.
Re: Substantive Comments Please: GCC vs. LLMV
Author: Chris Ahlstrom
Date: Wed, 04 Nov 2026 11:39
Date: Wed, 04 Nov 2026 11:39
70 lines
4733 bytes
4733 bytes
Richard Kettlewell wrote this screed in ALL-CAPS (fixed):
> Chris Ahlstrom <OFeem1987@teleworm.us> writes:
>> rbowman wrote this screed in ALL-CAPS (fixed):
>>> On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
>>>> It found a few issues in a couple of my projects, a few issues
>>>> important.
>>>> There is one that I don't get
>>>>
>>>> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
>>>> Memory allocated by 'new[]' should be deallocated by 'delete[]',
>>>> not 'getline()' [unix.MismatchedDeallocator]
>>>>
>>>> 1138 | ssize_t count { getline(&destination, &maxim, input) };
>>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>
>>>> I guess I need to use malloc() instead.
>>>
>>> Did you allocate destination with new? getline will malloc a buffer
>>> if you pass in NULL.
>>
>> Yes, and I know that from the man page.
>>
>> The point is scan-build complaining about something getline() will
>> not do in the given use case.
>>
>> A limitation of static analysis, perhaps.
>
> There’s not enough context to give a completely definitive answer, but:
>
> 1) Heap memory can be managed with new/delete, or with
> malloc/realloc/free, but not both. The consequences of playing
> mix-and-match vary between platform, so you might get away with it in
> some cases, by luck, but static analysis tools will consider it a
> bug, if they’re smart enough to notice.
The tool is clang's scan-build. Fortunately, meson automatically
sets a build to use it if it is installed. Otherwise I'd be too
damned lazy to use it :-D
> 2) In getline(), if *lineptr!=NULL then it will call realloc() on it if
> the line from stream needs more than *n bytes (using argument names
> from [1]). So passing a pointer allocated with new to it is a bug,
> for the reasons given in (1) above.
>
> 3) The diagnostic referring to deallocation reather than realloc is
> probably a (trivial) bug in the tool - for example it may model
> realloc as malloc+free, which isn’t unreasonable as such, but leads
> to an opaque diagnostic.
>
> The only case where it would not be a bug is if the line read by
> getline() can never possibly exceed the initial allocation. Whether this
> is true in your use case I don’t know, but your static analysis tool
> either couldn’t prove that it was or more likely, isn’t equipped to do
> so.
>
> [1] https://man7.org/linux/man-pages/man3/getline.3.html
I bit the bullet and went to malloc()/free().
Now I got a couple of "Method called on moved-from object"
warnings to fix. (A needless test of movement in a test app.)
--
I will not play at tug o' war. I'd rather play at hug o' war,
Where everyone hugs Instead of tugs,
Where everyone giggles And rolls on the rug,
Where everyone kisses, And everyone grins,
And everyone cuddles, And everyone wins.
-- Shel Silverstein, "Hug o' War"
Re: Substantive Comments Please: GCC vs. LLMV
Author: The Natural Philosopher
Date: Wed, 04 Nov 2026 11:53
Date: Wed, 04 Nov 2026 11:53
31 lines
2875 bytes
2875 bytes
On 04/11/2026 11:39, Chris Ahlstrom wrote: > I will not play at tug o' war. I'd rather play at hug o' war, > Where everyone hugs Instead of tugs, > Where everyone giggles And rolls on the rug, > Where everyone kisses, And everyone grins, > And everyone cuddles, And everyone wins. > -- Shel Silverstein, "Hug o' War" Penicillin Penny, she's the queen of the Sunset Strip If she ever gives you any then you better see your doctor real quick, gettin' bizarre From the back seat of Cadillac cars, to the floor of men's room bars She's Penicillin Penny and her future's written in the stars She's Penicillin Penny and ever since the day she came, came They say she's had so many, she gives 'em all numbers not names, bitch I always call her Hun' (honey), but she calls me one thousand and one And Penicillin Penny starts to boogie when the day is done Bring on the claps She's Penicillin Penny and if you ever see her passin' through Better run into your house before she stops and lays a little on you If you ever let her in your door, it takes 20 million units Or more to cure the love that Penicillin Penny's gonna lay on you -- Shel Silverstein, "Penicillin Penny" -- Civilization exists by geological consent, subject to change without notice. – Will Durant
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads