Sujet : Re: Baby X is bor nagain
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 03. Jul 2024, 02:47:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240702173023.907@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-03, bart <
bc@freeuk.com> wrote:
I really, really don't remember. I've tinkered with Linux every so often
for 20, maybe 25 years. You used to be able to order a job-lot of CDs
with different versions. Few did much.
Every major distro I've ever used going back ti 1995 made it optional
to install just about everything, including the compiler suite.
A very popular desktop distro is Ubuntu. GCC is not a base package in
Ubuntu.
Then there were various ones I tried under Virtual Box. All had gcc.
You might have been using some ready-to-run preinstalled Virtual Box
appliances, where someone already did the package selection for you and
included the dev tools.
If you have a program that uses a C compiler at run time, you will
have to ask the user to install one.
(If you make it work with something small like tcc, that would be
practical to bundle with your program in a self-contained way.
Doing that with GCC will bloat up your package.)
I 100% agree with you about the horrible compiler bloat.
It's like GCC is pregnant with octuplets: Two database engines (a boy
and a girl), a CAD suite, three operating system kernels, an office
productivity suite, ...
GCC doesn't produce much better code than it did 25 years ago,
and good luck running today's GCC on a machine from back then.
How you write your C still matters today, in spite of all the bloat.
I'e been using this snippet as a "litmus test" for decades:
void insert_before(node *succ, node *ins)
{
ins->prev = succ->prev;
ins->next = succ;
succ->prev->next = ins;
succ->prev = ins;
}
GCC today generates the same code as some 28 years ago, and
just like 28 years ago, you can shave an instruction off
the target code using:
void insert_before(node *succ, node *ins)
{
node *pred = succ->prev;
ins->prev = pred;
ins->next = succ;
pred->next = ins;
succ->prev = ins;
}
For all the bloat and slow compilation, how you code still
matters, and decades-old tricks are still relevant.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca