Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Entropy isn't what it used to be.


devel / comp.lang.c / Re: you think rust may *DE*throne c?

SubjectAuthor
* you think rust may outthrone c?fir
`* Re: you think rust may outthrone c?Blue-Maned_Hawk
 +- Re: you think rust may outthrone c?jak
 +* Re: you think rust may outthrone c?fir
 |`- Re: you think rust may outthrone c?fir
 +* Re: you think rust may outthrone c?rek2 hispagatos
 |`* Re: you think rust may outthrone c?Kaz Kylheku
 | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  +* Re: you think rust may outthrone c?Scott Lurndal
 |  |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?Bart
 |  | |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | +* Re: you think rust may outthrone c?Bart
 |  | | |+* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | ||`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | || `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |`* Re: you think rust may outthrone c?David Brown
 |  | | | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  +* Re: you think rust may outthrone c?David Brown
 |  | | |  |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |  | `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |   `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |    `* Re: you think rust may outthrone c?David Brown
 |  | | |     +* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |     |`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |     `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |      +- Re: you think rust may outthrone c?David Brown
 |  | | |      `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |       `* Re: you think rust may outthrone c?David Brown
 |  | | |        `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |         `* Re: you think rust may outthrone c?David Brown
 |  | | |          +- Re: you think rust may outthrone c?fir
 |  | | |          +* Re: you think rust may outthrone c?fir
 |  | | |          |`* Re: you think rust may outthrone c?fir
 |  | | |          | `- Re: you think rust may outthrone c?fir
 |  | | |          `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |           `* Re: you think rust may outthrone c?Bart
 |  | | |            +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |`* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | +* Re: you think rust may outthrone c?David Brown
 |  | | |            | |+* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||+* Re: you think rust may outthrone c?David Brown
 |  | | |            | |||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | ||||`* Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | |||| `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | |||`* Re: you think rust may outthrone c?Bart
 |  | | |            | ||| +- Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |            | ||`- Re: you think rust may outthrone c?Scott Lurndal
 |  | | |            | |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | | +- Re: you think rust may outthrone c?David Brown
 |  | | |            | | `* Re: you think rust may outthrone c?jak
 |  | | |            | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | |   +- Re: you think rust may outthrone c?jak
 |  | | |            | |   `- Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |  `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            |   +- Re: you think rust may outthrone c?David Brown
 |  | | |            |   `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            `* Re: you think rust may outthrone c?David Brown
 |  | | |             `* Re: you think rust may outthrone c?fir
 |  | | |              +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              |`* Re: you think rust may outthrone c?David Brown
 |  | | |              | +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | |+* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |              | |||`- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||`- Re: you think rust may outthrone c?fir
 |  | | |              | |`- Re: you think rust may outthrone c?Bart
 |  | | |              | `- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              `* Re: you think rust may outthrone c?fir
 |  | | |               `* Re: you think rust may outthrone c?Bart
 |  | | |                +* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||+- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||  `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   +* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   | `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |  `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| ||    `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?Ike Naar
 |  | | |                ||| |||`- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| || +* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |                ||| || `* Re: you think rust may outthrone c?Bart
 |  | | |                ||| |`* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |                ||| `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                ||`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                `* Re: you think rust may outthrone c?fir
 |  | | +* Yeah, C is harder than many programming languages. Your point? (Was: you think Kenny McCormack
 |  | | +* Re: you think rust may outthrone c?Po Lu
 |  | | `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?David Brown
 |  | `- Re: you think rust may outthrone c?Po Lu
 |  `* Re: you think rust may outthrone c?Anton Shepelev
 `* Re: you think rust may outthrone c?Bonita Montero

Pages:123456789101112131415161718192021222324252627282930313233343536373839
Re: you think rust may *DE*throne c?

<ub5qb0$tvfm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27487&group=comp.lang.c#27487

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 18:15:12 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <ub5qb0$tvfm$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad> <ub5gt5$sgug$1@dont-email.me>
<OCsBM.562405$AsA.470376@fx18.iad> <ub5ng5$tdpe$1@dont-email.me>
<qItBM.59031$m8Ke.4230@fx08.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 17:15:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e57af83912fa92cd513fea0a1b729ed";
logging-data="982518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8Eb374oC/GhFuxEs1WXuInuVBPgGSEC0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:H/wOHZ9nzQvdJePpOaurGxOnPsc=
In-Reply-To: <qItBM.59031$m8Ke.4230@fx08.iad>
 by: Bart - Fri, 11 Aug 2023 17:15 UTC

On 11/08/2023 17:53, Scott Lurndal wrote:
> Bart <bc@freeuk.com> writes:
>> On 11/08/2023 16:39, Scott Lurndal wrote:
>>> Bart <bc@freeuk.com> writes:
>>>> On 11/08/2023 14:32, Scott Lurndal wrote:
>>
>>>>> Perhaps it is time to simply stop responding to Bart when he continues
>>>>> to make such silly statements.
>>>>
>>>> What exactly is silly about it? Isn't that what is being said or not?
>>>
>>> Nobody has told you what you're allowed to have in your directories.
>>>
>>
>> So I must have misunderstood these comments:
>
>
> Yes, you did. As always.

So what do they mean?

Can I still usefully do gcc -MM *.c if I ignore that advice?

>>
>> RH: Then you have too many unrelated things in that directory.
>>
>> BC: That happens.
>>
>> SL: No, it doesn't. Except, perhaps to you.
>>
>> DB: Put the files of a project in a directory. Delete the junk.

Re: you think rust may *DE*throne c?

<f7db79d7-23cf-45f2-8bf8-74436cd07054n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27488&group=comp.lang.c#27488

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5b91:0:b0:403:a6db:42ad with SMTP id a17-20020ac85b91000000b00403a6db42admr38113qta.9.1691774453450;
Fri, 11 Aug 2023 10:20:53 -0700 (PDT)
X-Received: by 2002:a05:6a00:18a3:b0:686:2ad5:d132 with SMTP id
x35-20020a056a0018a300b006862ad5d132mr995635pfh.5.1691774453178; Fri, 11 Aug
2023 10:20:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 11 Aug 2023 10:20:52 -0700 (PDT)
In-Reply-To: <ub5oio$tmpp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.244; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.244
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk>
<uavpcf$3t64r$1@dont-email.me> <slrnud6spf.f45.dan@djph.net>
<ub010k$3um69$1@dont-email.me> <ub04i1$3v4p5$2@dont-email.me>
<ub06ih$3vdv6$1@dont-email.me> <ub4lb2$olm3$1@dont-email.me>
<ub51sl$qadl$1@dont-email.me> <BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com> <hCsBM.562404$AsA.500972@fx18.iad>
<ub5oio$tmpp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f7db79d7-23cf-45f2-8bf8-74436cd07054n@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: profesor...@gmail.com (fir)
Injection-Date: Fri, 11 Aug 2023 17:20:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4094
 by: fir - Fri, 11 Aug 2023 17:20 UTC

piątek, 11 sierpnia 2023 o 18:45:26 UTC+2 Kalevi Kolttonen napisał(a):
> Scott Lurndal <sc...@slp53.sl.home> wrote:
> > Nobody is telling Bart "exactly what they're allowed
> > to have in their folders". That's just nonsense.
> Agreed. It is total nonsense, because nobody has made
> such claims.
>
> This thread is so long that I may have lost track
> already, but I suppose Bart does not want to
> create subdirectories. Instead he has a single
> directory, perhaps called "c" and all his not so
> important small C programs get dumped there.
>
> So his main directory contents probably look something
> like this:
>
> do-one-thing.c
> do-another-thing.c
> do-third-thing.c
> [ and so on ]
>
> I do not undestand why Bart cannot simply do:
>
> mkdir do-one-thing do-another-thing do-third-thing
> mv do-one-thing.c do-one-thing
> mv do-another-thing.c do-another-thing
> mv do-third-thing.c do-third-thing
> [ and so on ]
>
> So the directory hierarchy would be:
>
> c/do-one-thing
> c/do-another-thing
> c/do-third-thing
>
> and all the C programs would be contained in self-documenting
> subdirectories.
>
> For some unknown reason Bart wants to keep all the unrelated
> C files in the one directory. Have I undestood this right?
>
> br,
> KK

bartc seem to be a fan of parctical simplicity and he is totally right in that aspect imo (not reading into that particular case as i got other things to do)
i hovever keep code in subdirectories, but even thiose subdirectories you could have tens..
this layer of managing source is overcomplicated as it should as it was already talked... im a fan of totakl commander and imo given.c source probably should compile to dll simply if you press enter on it, and compile to exe also if you press enter on it and it have "main" method

that should be a rule so no weird build system and trash

(this makes a problem you cant divide such c files on parts having large files
becouse if you would divide it couldnt compile unles having reference to its other parts (two-direction references, part should know the container) but there is
a way of dealing with this, else adding thsi reference or ignore or eventually
rename such included partswith other extension, or other way eventually also compile toi some .o partial format

Re: you think rust may *DE*throne c?

<ub5rgt$u502$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27489&group=comp.lang.c#27489

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 18:35:25 +0100
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <ub5rgt$u502$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 17:35:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e57af83912fa92cd513fea0a1b729ed";
logging-data="988162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wQNb6CJclyShehZVDwdu5OEx48WKq9ao="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:o+K74wIIl1dvypREdf0PVo+hPHc=
In-Reply-To: <ub5oio$tmpp$1@dont-email.me>
 by: Bart - Fri, 11 Aug 2023 17:35 UTC

On 11/08/2023 17:45, Kalevi Kolttonen wrote:
> Scott Lurndal <scott@slp53.sl.home> wrote:
>> Nobody is telling Bart "exactly what they're allowed
>> to have in their folders". That's just nonsense.
>
> Agreed. It is total nonsense, because nobody has made
> such claims.
>
> This thread is so long that I may have lost track
> already, but I suppose Bart does not want to
> create subdirectories. Instead he has a single
> directory, perhaps called "c" and all his not so
> important small C programs get dumped there.

Yes, exactly.

Actual applications get their own directory. But generally I don't use C
for those. I use my private language with a module system which can
discover all the modules of a project without needing to segregate
project-related files from anything else.

It mainly happens with C applications that have been downloaded, and
there, ones that have .c and .h files scattered over a dozen nested
directories are a complete PITA. Given that the supplied build process
on Windows rarely works so I end up doing the chasing around.

Of course, any C programs *I* supply are designed to be as easy to build
as `hello.c`. And on Windows that is achievable:

c:\qx>gcc qc.c -oqq
c:\qx>qq hello
Hello, World! 11-Aug-2023 18:24:54

qc.c is a 43Kloc C source file implementing an interpreter (transpiled
from non-C source code in 30+ modules).

On Linux, it would be something like this:

gcc qc.c -oqq -lm -ldl -fno-builtin
./qq hello

Now, please tell me what is the point of creating a subdirectory to
contain only the one file. Or indeed, what is the point of using 'make'
in this case.

All that's needed is a compiler, and the one source file; three as we
all know is a crowd.

> For some unknown reason Bart wants to keep all the unrelated
> C files in the one directory. Have I undestood this right?

I use folders to represent different projects. I don't take that
structuring to the extreme as many do. I've seen Github projects use a
dozen or two directories, each one has only one file, and the total,
initially imposing application turns out to be a 300-line toy program.

It's just 10 times harder to study, understand and build.

Re: you think rust may *DE*throne c?

<ub5s66$u502$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27490&group=comp.lang.c#27490

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 18:46:47 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <ub5s66$u502$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad> <ub5gt5$sgug$1@dont-email.me>
<OCsBM.562405$AsA.470376@fx18.iad> <ub5ng5$tdpe$1@dont-email.me>
<qItBM.59031$m8Ke.4230@fx08.iad> <ub5qb0$tvfm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 11 Aug 2023 17:46:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e57af83912fa92cd513fea0a1b729ed";
logging-data="988162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bp08EyH/Pq8Bj2H42fThNHSFqZy5MZ+A="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:GXaOz2TrsGspGXMRhANZS/UTiNI=
In-Reply-To: <ub5qb0$tvfm$1@dont-email.me>
 by: Bart - Fri, 11 Aug 2023 17:46 UTC

On 11/08/2023 18:15, Bart wrote:
> On 11/08/2023 17:53, Scott Lurndal wrote:
>> Bart <bc@freeuk.com> writes:
>>> On 11/08/2023 16:39, Scott Lurndal wrote:
>>>> Bart <bc@freeuk.com> writes:
>>>>> On 11/08/2023 14:32, Scott Lurndal wrote:
>>>
>>>>>> Perhaps it is time to simply stop responding to Bart when he
>>>>>> continues
>>>>>> to make such silly statements.
>>>>>
>>>>> What exactly is silly about it? Isn't that what is being said or not?
>>>>
>>>> Nobody has told you what you're allowed to have in your directories.
>>>>
>>>
>>> So I must have misunderstood these comments:
>>
>>
>> Yes, you did.  As always.
>
> So what do they mean?
>
> Can I still usefully do gcc -MM *.c if I ignore that advice?
>

BTW no one has commented on my own build scheme for C that I've
mentioned a few times.

So I have a program 'pidemo.c' which if I try and build it like this:

bcc pidemo

it reports some undefined functions. It needs a library which exists in
one or more extra .c files. Which ones? Well, why not let it discover
them for itself:

c:\c>bcc -auto pidemo
1 Compiling pidemo.c to pidemo.asm (Pass 1)
* 2 Compiling bignum.c to bignum.asm (Pass 2)
Assembling to pidemo.exe

So you can takes your 'gcc -MM *.c', which requires hygienically clean
directories, and shove it wherever the hell you like.

My demo was run inside that folder with 260 assorted 'junk' C files. Magic!

Re: you think rust may *DE*throne c?

<ub5vh9$un2j$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27492&group=comp.lang.c#27492

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 19:43:53 +0100
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <ub5vh9$un2j$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 18:43:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f064053cde5ca5ff2b7f2ea1c43203f7";
logging-data="1006675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P16ERGoXGskoMv94bEfr9bPTOMnEj5uo="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock: sha1:HKenmGEM6WEIs+K6XPBF3P7mz9Q=
In-Reply-To: <BLqBM.109943$8_8a.102743@fx48.iad>
 by: Richard Harnden - Fri, 11 Aug 2023 18:43 UTC

On 11/08/2023 14:32, Scott Lurndal wrote:
> Bart <bc@freeuk.com> writes:
>> On 11/08/2023 07:43, David Brown wrote:
>>> On 09/08/2023 16:07, Bart wrote:
>>>> On 09/08/2023 14:32, Richard Harnden wrote:
>>>> > On 09/08/2023 13:32, Bart wrote:
>>>> >> Yes, that is one reason that it is so complicated. You have to
>> define
>>>> >> set of dependences between modules (and you may need to do that
>>>> >> manually, so it can be error prone).
>>>> >
>>>> > $ gcc -MM *.c
>>>>
>>>> I have a small, 3-file project (one of Chris's) comprising files
>>>> cipher.c, sha2.c, hmac.c
>>>>
>>>> gcc -MM cipher.c outputs:
>>>>
>>>> cipher.o: cipher.c hmac.c sha2.h
>>>>
>>>> I need to do -MM cipher.c hmac.c sha2.c for it to show:
>>>>
>>>> cipher.o: cipher.c hmac.h sha2.h
>>>> hmac.o: hmac.c hmac.h sha2.h
>>>> sha2.o: sha2.c sha2.h
>>>>
>>>> So I had to tell it the C files. I can't do *.c, as there are 259
>>>> other .c files in the folder.
>>>>
>>>
>>> There's this wonderful organisation technique for files called
>>> "directories". They even exist in Windows.
>>>
>>> Put the files of a project in a directory. Delete the junk. Then you
>>> can find your files, and you can use "gcc -MM *.c". It even works if
>>> you have multiple different programs - it simply generates dependency
>>> information so you know which C files need re-compiled when headers are
>>> changed.
>>>
>>> But of course when someone gives you help or answers your questions,
>>> you'd rather complain more.
>>>
>>
>> So you're telling people exactly what they're allowed to have in their
>> folders and what they're not.
>
> Perhaps it is time to simply stop responding to Bart when he continues
> to make such silly statements.

I think he's being wrong on purpose. Or just for effect.

If I tar xvzf project-version.tgz,
I expect it to go into ./project-version

If I git clone project,
I expect it to go into ./project

To have everything end up in once directory takes effort.

Re: you think rust may *DE*throne c?

<20230811122917.667@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27493&group=comp.lang.c#27493

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 19:41:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <20230811122917.667@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<87bkffg6qz.fsf@bsb.me.uk> <ub1840$3q1k$1@dont-email.me>
<87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
<20230810090521.27@kylheku.com> <UKVPuuMp3KUo8mPWS@bongo-ra.co>
<20230810230301.714@kylheku.com> <2KqBM.109942$8_8a.102233@fx48.iad>
Injection-Date: Fri, 11 Aug 2023 19:41:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f5c92b33059ba4d876d949c7c374bed5";
logging-data="1026940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++pjUGGEiRtoXRKhlt0So9cVGzJ8+WNaI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:l19EhB48l57SYGpkpkqVIRzJ8Tw=
 by: Kaz Kylheku - Fri, 11 Aug 2023 19:41 UTC

On 2023-08-11, Scott Lurndal <scott@slp53.sl.home> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>On 2023-08-11, Spiros Bousbouras <spibou@gmail.com> wrote:
>>> On Thu, 10 Aug 2023 16:15:32 -0000 (UTC)
>>> Kaz Kylheku <864-117-4973@kylheku.com> wrote:
>>>> What we could have is that an executable just dynamically links to
>>>> functions in these libraries, and the system automatically finds them at
>>>> load time, without the executable having to specify which libraries. >>>
>>> And how is your scheme different than how it already works in the Unix
>>> world ?
>>
>>How it differs is that the executable has to nominate the specific
>>libraries by indicating the library, which came in via the -l option,
>>and then look for specific symbols from specific libraries that it has
>>attached.
>>
>>Under the hood, the semantics is much like dlopen() of specific
>>liraries to obtain a handle and then doing dlsym(handle, "name")
>>to look for specific names from specific libs.
>>
>>Imagine it could specify just symbols, without specifying where
>>they come from; that's a big difference.
>
> Would this not require that no symbol be present in more than
> one library, i.e. that there is a single symbol namespace across the
> entire system?
>
> That would seem to be a non-starter.

I sort of addressed that in the parts that were snipped above.
We also have the problem that multiple versions of the same library
can exist (or multiple version nodes within the same library).

There would have to be some mechanism to bind the visible,
simple symbols to unique identities under the hood.

E.g the <stdio.h> header could have some magic so that
when you include it and call puts, a complex symbolic reference
is generated under the hood and imbued into the resulting
executable.

Insert other handwaving as necessary.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: you think rust may *DE*throne c?

<ub65v9$vpca$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27494&group=comp.lang.c#27494

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: kal...@kolttonen.fi (Kalevi Kolttonen)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 20:33:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Sender: <untosten@0.0.0.0>
Message-ID: <ub65v9$vpca$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me> <ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me> <ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me> <BLqBM.109943$8_8a.102743@fx48.iad> <f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com> <hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me> <ub5rgt$u502$1@dont-email.me>
Injection-Date: Fri, 11 Aug 2023 20:33:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5ce9f7dcc230b17636adba8440509e38";
logging-data="1041802"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kXMtIvB0Qc0WFkQcjheJyBayqM8ab1GU="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.4.9-200.fc38.x86_64 (x86_64))
Cancel-Lock: sha1:aRkzgQEFJ6UWsPtmvBnp/E5Kcp8=
 by: Kalevi Kolttonen - Fri, 11 Aug 2023 20:33 UTC

Bart <bc@freeuk.com> wrote:
> Now, please tell me what is the point of creating a subdirectory to
> contain only the one file. Or indeed, what is the point of using 'make'
> in this case.

Sorry, I really haven't followed this thread with that
great interest or mental concentration. I am only guessing
here but I suppose you wanted to do something like:

gcc *.c

and that fails because your main directory contains over
250 C source files. If you put them into their own
subdirectories, you would need:

cd subdir
gcc *.c

Maybe I have misunderstood something, but this discussion
seems pretty insane.

br,
KK

Re: you think rust may *DE*throne c?

<877cq1nwan.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27495&group=comp.lang.c#27495

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 13:44:48 -0700
Organization: None to speak of
Lines: 22
Message-ID: <877cq1nwan.fsf@nosuchdomain.example.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a0d57af85f9a222b5965d517e21e5af";
logging-data="1043701"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j0PEU/ydONsA4V00pepSa"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:SWTnl/R/G3QolN4mgVdkEqh0y+w=
sha1:+oLAyENiU2VK5v7gDAmMn6mmYr4=
 by: Keith Thompson - Fri, 11 Aug 2023 20:44 UTC

Bart <bc@freeuk.com> writes:
[...]
> Now, please tell me what is the point of creating a subdirectory to
> contain only the one file. Or indeed, what is the point of using
> 'make' in this case.
[...]

You have more than enough information to figure out what works best
for you. Just do that.

If you don't want to use make, don't use make. If you don't want
to create subdirectories, don't create subdirectories.

Some people in this thread have made the mistake of offering
you advice. That never ends well. Most people, if they say that
something is not working well for them, are implicitly asking for
better alternatives. That doesn't seem to be the case for you.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: you think rust may *DE*throne c?

<ub682b$104gj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27496&group=comp.lang.c#27496

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 22:09:32 +0100
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <ub682b$104gj$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <ub65v9$vpca$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 21:09:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e57af83912fa92cd513fea0a1b729ed";
logging-data="1053203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Lb5pKtddaVCY5oetr8jfA9OdV2ddnJi8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:LkTuC8e+n+vsYNVSKet9YPEhgYs=
In-Reply-To: <ub65v9$vpca$1@dont-email.me>
 by: Bart - Fri, 11 Aug 2023 21:09 UTC

On 11/08/2023 21:33, Kalevi Kolttonen wrote:
> Bart <bc@freeuk.com> wrote:
>> Now, please tell me what is the point of creating a subdirectory to
>> contain only the one file. Or indeed, what is the point of using 'make'
>> in this case.
>
> Sorry, I really haven't followed this thread with that
> great interest or mental concentration. I am only guessing
> here but I suppose you wanted to do something like:
>
> gcc *.c
>
> and that fails because your main directory contains over
> 250 C source files. If you put them into their own
> subdirectories, you would need:
>
> cd subdir
> gcc *.c
>
> Maybe I have misunderstood something, but this discussion
> seems pretty insane.

I mentioned something about needing to manually write dependencies
inside makefiles.

Somebody said you can get gcc to do that with 'gcc -MM *.c'.

I then said then you'd need a clean directory with only those exact
files present.

And this is when a ton of bricks were heaped upon me by numerous posters.

Apparently the idea of having two .c files in the same folder, that
belong to different programs, is anathema.

I had thought that -MM was some clever option where gcc can crawl
through dependencies discovering the necessary files needed for a
project (a bit like the -auto experimental feature in my own compiler).

But apparently not. Either you to have submit the exact files required,
or marshall them into a dedicated folder and do *.c.

Either way, 'make' is not something I will ever use, and it was a
throwaway remark. I only come across makefiles when they are the only
way to get information about building an open source project, since
simply listing the .c files needed would be too easy.

However I wouldn't be averse to just doing gcc *.c as the build process.
And here, for a specially created distribution for other people to use,
it makes sense to ensure only the relevant files for the project are
present.

My own approach if I had to distribute a project with multiple .c files,
would be to list them in an @ file, as being more robust, and not
requiring the file-expansion needing for *.c which is not automatic
under Windows.

However I also like to distribute software (for the purpose of building
a binary from source), as a single amalgamated .c file. Hence my comment
at the top; no need to use dedicated folders or tools like make, which
are overkill.

(And thank you the civil post; that makes a change!)

Re: you think rust may *DE*throne c?

<20230811142521.298@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27497&group=comp.lang.c#27497

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 21:30:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <20230811142521.298@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <ub65v9$vpca$1@dont-email.me>
Injection-Date: Fri, 11 Aug 2023 21:30:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f5c92b33059ba4d876d949c7c374bed5";
logging-data="1056915"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GHObNTCSc0C7wHE9l7i8yyO77rVg+Oe0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:vQqnDLQXD2kSolwmpOPv7M0UwQs=
 by: Kaz Kylheku - Fri, 11 Aug 2023 21:30 UTC

On 2023-08-11, Kalevi Kolttonen <kalevi@kolttonen.fi> wrote:
> Bart <bc@freeuk.com> wrote:
>> Now, please tell me what is the point of creating a subdirectory to
>> contain only the one file. Or indeed, what is the point of using 'make'
>> in this case.
>
> Sorry, I really haven't followed this thread with that
> great interest or mental concentration. I am only guessing
> here but I suppose you wanted to do something like:
>
> gcc *.c
>
> and that fails because your main directory contains over
> 250 C source files. If you put them into their own
> subdirectories, you would need:
>
> cd subdir
> gcc *.c

Well, no:

gcc suba/*.c subb/*.c subc/*.c

or with Bash brace expansion
gcc sub{a,b,c}/*.c

> Maybe I have misunderstood something, but this discussion
> seems pretty insane.

That it is.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: you think rust may *DE*throne c?

<20230811143115.205@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27498&group=comp.lang.c#27498

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 21:38:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20230811143115.205@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me>
Injection-Date: Fri, 11 Aug 2023 21:38:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f5c92b33059ba4d876d949c7c374bed5";
logging-data="1056915"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PgfAsYR+bNucReJJwf++hlBFks7i/Mzk="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Ve5r+cyIFPmQ9x1yv//Md52cA/s=
 by: Kaz Kylheku - Fri, 11 Aug 2023 21:38 UTC

On 2023-08-11, Bart <bc@freeuk.com> wrote:
> Now, please tell me what is the point of creating a subdirectory to
> contain only the one file. Or indeed, what is the point of using 'make'
> in this case.

If you don't see a technical point of using make in a certain situation,
there almost certainly isn't one.

Sometimes people write Makefiles (or follow other conventions) simply
to be compatible wth a common convention.

If you're writing code for an audience which expects to build
a program similarly to this:

$ ./configure && make && make install

then if you make that work, there are no surprises.

The point is to conform to social conventions than to meet
a technical objective in the simplest way.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: you think rust may *DE*throne c?

<ub6a7i$10cku$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27499&group=comp.lang.c#27499

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 22:46:27 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <ub6a7i$10cku$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <20230811143115.205@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 21:46:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e57af83912fa92cd513fea0a1b729ed";
logging-data="1061534"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gg8W4BcHBcWdOxJmyXgkPIgK3yI7U8Ec="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:WL5gDnamULBYybWXzkRfj1eFIf4=
In-Reply-To: <20230811143115.205@kylheku.com>
 by: Bart - Fri, 11 Aug 2023 21:46 UTC

On 11/08/2023 22:38, Kaz Kylheku wrote:
> On 2023-08-11, Bart <bc@freeuk.com> wrote:
>> Now, please tell me what is the point of creating a subdirectory to
>> contain only the one file. Or indeed, what is the point of using 'make'
>> in this case.
>
> If you don't see a technical point of using make in a certain situation,
> there almost certainly isn't one.
>
> Sometimes people write Makefiles (or follow other conventions) simply
> to be compatible wth a common convention.
>
> If you're writing code for an audience which expects to build
> a program similarly to this:
>
> $ ./configure && make && make install
>
> then if you make that work, there are no surprises.
>
> The point is to conform to social conventions than to meet
> a technical objective in the simplest way.
>
>

K&R2 page 6 explains how to compile hello.c:

cc hello.c

I want to keep that simplicity, even for much larger projects.

(However, it then goes on to say (without explanation) that it creates
a.out! <face palm>)

Well at least it doesn't bang on about 'make' and folders.

Re: you think rust may *DE*throne c?

<ub6aoa$10e72$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27500&group=comp.lang.c#27500

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 14:55:21 -0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <ub6aoa$10e72$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <877cq1nwan.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Aug 2023 21:55:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c2f23208765cbb292168f93687392286";
logging-data="1063138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UzOIrDYpz/ECafxKr8HYdepueYgtjNLY="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:055ic3m42622uT7B9nP4jOxKEFM=
Content-Language: en-US
In-Reply-To: <877cq1nwan.fsf@nosuchdomain.example.com>
 by: Chris M. Thomasson - Fri, 11 Aug 2023 21:55 UTC

On 8/11/2023 1:44 PM, Keith Thompson wrote:
> Bart <bc@freeuk.com> writes:
> [...]
>> Now, please tell me what is the point of creating a subdirectory to
>> contain only the one file. Or indeed, what is the point of using
>> 'make' in this case.
> [...]
>
> You have more than enough information to figure out what works best
> for you. Just do that.
>
> If you don't want to use make, don't use make. If you don't want
> to create subdirectories, don't create subdirectories.
>
> Some people in this thread have made the mistake of offering
> you advice. That never ends well. Most people, if they say that
> something is not working well for them, are implicitly asking for
> better alternatives. That doesn't seem to be the case for you.
>

Bart is a nice person. I feel like looking up some older conversations
we had. Iiirc, they were rather productive, indeeed. About an encryption
algo of mine....

Re: you think rust may *DE*throne c?

<ub6b0q$10he3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27501&group=comp.lang.c#27501

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 22:59:53 +0100
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <ub6b0q$10he3$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <ub65v9$vpca$1@dont-email.me>
<ub682b$104gj$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 11 Aug 2023 21:59:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f064053cde5ca5ff2b7f2ea1c43203f7";
logging-data="1066435"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MdjlhKxH8DTTF1smYog6lLc5YhSBbGPU="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock: sha1:9GCKeWLskMdpH3QaNea3u1L/6cs=
In-Reply-To: <ub682b$104gj$1@dont-email.me>
 by: Richard Harnden - Fri, 11 Aug 2023 21:59 UTC

On 11/08/2023 22:09, Bart wrote:
> On 11/08/2023 21:33, Kalevi Kolttonen wrote:
> > Bart <bc@freeuk.com> wrote:
> >> Now, please tell me what is the point of creating a subdirectory to
> >> contain only the one file. Or indeed, what is the point of using 'make'
> >> in this case.
> >
> > Sorry, I really haven't followed this thread with that
> > great interest or mental concentration. I am only guessing
> > here but I suppose you wanted to do something like:
> >
> >    gcc *.c
> >
> > and that fails because your main directory contains over
> > 250 C source files. If you put them into their own
> > subdirectories, you would need:
> >
> >   cd subdir
> >   gcc *.c
> >
> > Maybe I have misunderstood something, but this discussion
> > seems pretty insane.
>
> I mentioned something about needing to manually write dependencies
> inside makefiles.
>
> Somebody said you can get gcc to do that with 'gcc -MM *.c'.

Well, you can. You'd end up with 250 lines of stuff like ...

foo.o : foo.c foo.h bar.h

.... but only a few of those lines would actually matter to your
prog.exe, the rest is just noise.

But, really, having all your unrelated source files in one directory is
lazy/messy/idiotic.

>
> I then said then you'd need a clean directory with only those exact
> files present.

It would help, sure - but you don't /have/ to.

>
> And this is when a ton of bricks were heaped upon me by numerous posters.
>
> Apparently the idea of having two .c files in the same folder, that
> belong to different programs, is anathema.

It's not unusual for a project to have more that one executable, some of
them sharing the same source files. This is normal.

Re: you think rust may *DE*throne c?

<ub6g1t$11b5u$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27502&group=comp.lang.c#27502

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: kal...@kolttonen.fi (Kalevi Kolttonen)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Fri, 11 Aug 2023 23:25:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Sender: <untosten@0.0.0.0>
Message-ID: <ub6g1t$11b5u$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me> <ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me> <ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me> <BLqBM.109943$8_8a.102743@fx48.iad> <f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com> <hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me> <ub5rgt$u502$1@dont-email.me> <ub65v9$vpca$1@dont-email.me> <ub682b$104gj$1@dont-email.me>
Injection-Date: Fri, 11 Aug 2023 23:25:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="68663622598ddf3761efb03398d1ccb9";
logging-data="1092798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183Jx9/8q+oM0OUVSrKsuIFx3X9S1bSXGk="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.4.9-200.fc38.x86_64 (x86_64))
Cancel-Lock: sha1:Pj+wSnmIvS/4QWggLd8Vc8ljiic=
 by: Kalevi Kolttonen - Fri, 11 Aug 2023 23:25 UTC

Bart <bc@freeuk.com> wrote:
> I mentioned something about needing to manually write dependencies
> inside makefiles.
>
> Somebody said you can get gcc to do that with 'gcc -MM *.c'.
>
> I then said then you'd need a clean directory with only those exact
> files present.
>
> And this is when a ton of bricks were heaped upon me by numerous posters.

I see. Thanks for the explanation.

> Apparently the idea of having two .c files in the same folder, that
> belong to different programs, is anathema.

It is pretty unusual, yes.

I am not a build expert by any means, but I have written some
Makefiles like most do on Unix machines. According to Wikipedia:

https://en.wikipedia.org/wiki/Make_(software)

Make first appeared in April 1976. That was a long time ago.
It is a well-established tool.

The usages of Make are not limited to programming languages
like C. It is a pretty general dependency tracking system
and I have also used it for tasks like automating the
building of LaTeX documents.

br,
KK

Re: you think rust may *DE*throne c?

<20230811172001.640@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27503&group=comp.lang.c#27503

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Sat, 12 Aug 2023 00:26:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20230811172001.640@kylheku.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <ub65v9$vpca$1@dont-email.me>
<ub682b$104gj$1@dont-email.me> <ub6g1t$11b5u$1@dont-email.me>
Injection-Date: Sat, 12 Aug 2023 00:26:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3e40dc164c77a4336b6eaa78fd02fe1b";
logging-data="1105402"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CRsQoQ7431l93QaLQs7MCYDv3u0lB8hI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:kyBGowPQdcjZvdrQxtLwWKFZ2uA=
 by: Kaz Kylheku - Sat, 12 Aug 2023 00:26 UTC

On 2023-08-11, Kalevi Kolttonen <kalevi@kolttonen.fi> wrote:
> The usages of Make are not limited to programming languages
> like C. It is a pretty general dependency tracking system
> and I have also used it for tasks like automating the
> building of LaTeX documents.

Make could be used to express the dependencies among start-up
activities in a system. Parallel make could then reduce the
boot-up time.

E.g. all things dependent on "networking", but independent of
each other, could start at the same time, thanks to make -j.

Probably most or all of it would be phony targets (no checking of any
file time stamps).

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: you think rust may *DE*throne c?

<ub7ga2$18t8e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27506&group=comp.lang.c#27506

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Sat, 12 Aug 2023 10:36:18 +0200
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <ub7ga2$18t8e$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<20230809091709.678@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 12 Aug 2023 08:36:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7fce7aea97fcdc1d9db7629496ae8342";
logging-data="1340686"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QfiTlKBX+Nk2raURT+EZnOf30k4Duy98="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:OXs6PBW7twK+xFunAdd4D4R9lvw=
In-Reply-To: <20230809091709.678@kylheku.com>
Content-Language: en-GB
 by: David Brown - Sat, 12 Aug 2023 08:36 UTC

On 09/08/2023 18:34, Kaz Kylheku wrote:
> On 2023-08-09, Bart <bc@freeuk.com> wrote:
>> On 09/08/2023 14:32, Richard Harnden wrote:
>>> On 09/08/2023 13:32, Bart wrote:
>>>> Yes, that is one reason that it is so complicated. You have to define
>>>> set of dependences between modules (and you may need to do that
>>>> manually, so it can be error prone).
>>>
>>> $ gcc -MM *.c
>>
>> I have a small, 3-file project (one of Chris's) comprising files
>> cipher.c, sha2.c, hmac.c
>>
>> gcc -MM cipher.c outputs:
>>
>> cipher.o: cipher.c hmac.c sha2.h
>>
>> I need to do -MM cipher.c hmac.c sha2.c for it to show:
>>
>> cipher.o: cipher.c hmac.h sha2.h
>> hmac.o: hmac.c hmac.h sha2.h
>> sha2.o: sha2.c sha2.h
>>
>> So I had to tell it the C files. I can't do *.c, as there are 259 other
>> .c files in the folder.
>
> What you do is use the -MMD option of gcc which causes it
> to compile regularly while writing the dependency information to
> a .d file.
>
> These .d files are included into the Makefile (using -include
> so that the include doesn't fail when they don't yet exist).
>
> When a project is newly compiled from a clean state, dependencies
> are not required because everything must be built.
>
> After the first full build, you then have the .d files.
>
> It's a far from perfect solution. One problem is that when you make a
> change that removes a header file, the build breaks, due to a missing
> dependency. The dependency can't be fixed automatically because make
> wont't run the rule which does that. You either clean away all the
> dependencies, or if you don't want to suffer the rebuild time, you have
> to hunt down all the .d files which mention the removed header and blow
> those off.
>

You can do better than that. You can generate dependency rules for the
dependency files. My makefile has a rule template that is run for each
source directory. Part of that includes:

define compile_rule_template
# $(1) = directory
# $(2) = extra common flags
# $(3) = extra c flags
# $(4) = extra cpp flags

# First, rules to generate target directories as needed
$(dep_dir)$(1) $(obj_dir)$(1) $(lst_dir)$(1) :
$(MKDIR) -p $$@

# Generate dependancy files
$(dep_dir)$(1)%.d : $(1)%.c $(alldepends) | $(dep_dir)$(1)
@echo Generating depency file $$@
$(CCDEP) $(combined_cflags) $(2) $(3) -MM -MP \
-MT $(obj_dir)$(1)$$(@F:%.d=%.o) -MT \
$(dep_dir)$(1)$$(@F:%.o=%.o) \
-MF $$@ $$<

I'll let you look up the gcc manual and make manual for the details of
how this all works. It generates the dependency files automatically,
and updates them automatically. Obviously you need to set the variables
referenced, so that your object files and dependency files are in
separate trees from the source files.

I was a little reluctant to post this because Bart will get his knickers
in a twist over it, but you might find it useful or inspirational.

Re: you think rust may *DE*throne c?

<44305fed-5f5f-47b8-84e9-5ca042767742n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27507&group=comp.lang.c#27507

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7d43:0:b0:405:4eec:6352 with SMTP id h3-20020ac87d43000000b004054eec6352mr65710qtb.11.1691834288175;
Sat, 12 Aug 2023 02:58:08 -0700 (PDT)
X-Received: by 2002:a17:90a:b798:b0:262:de4e:3967 with SMTP id
m24-20020a17090ab79800b00262de4e3967mr909986pjr.0.1691834287636; Sat, 12 Aug
2023 02:58:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 12 Aug 2023 02:58:06 -0700 (PDT)
In-Reply-To: <ub7ga2$18t8e$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:868:d0a4:2df0:ec16;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:868:d0a4:2df0:ec16
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com> <p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com> <87zg31ezu5.fsf@bsb.me.uk>
<uavpcf$3t64r$1@dont-email.me> <slrnud6spf.f45.dan@djph.net>
<ub010k$3um69$1@dont-email.me> <ub04i1$3v4p5$2@dont-email.me>
<ub06ih$3vdv6$1@dont-email.me> <20230809091709.678@kylheku.com> <ub7ga2$18t8e$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <44305fed-5f5f-47b8-84e9-5ca042767742n@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Sat, 12 Aug 2023 09:58:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Malcolm McLean - Sat, 12 Aug 2023 09:58 UTC

On Saturday, 12 August 2023 at 09:36:35 UTC+1, David Brown wrote:
> On 09/08/2023 18:34, Kaz Kylheku wrote:
> > On 2023-08-09, Bart <b...@freeuk.com> wrote:
> >> On 09/08/2023 14:32, Richard Harnden wrote:
> >>> On 09/08/2023 13:32, Bart wrote:
> >>>> Yes, that is one reason that it is so complicated. You have to define
> >>>> set of dependences between modules (and you may need to do that
> >>>> manually, so it can be error prone).
> >>>
> >>> $ gcc -MM *.c
> >>
> >> I have a small, 3-file project (one of Chris's) comprising files
> >> cipher.c, sha2.c, hmac.c
> >>
> >> gcc -MM cipher.c outputs:
> >>
> >> cipher.o: cipher.c hmac.c sha2.h
> >>
> >> I need to do -MM cipher.c hmac.c sha2.c for it to show:
> >>
> >> cipher.o: cipher.c hmac.h sha2.h
> >> hmac.o: hmac.c hmac.h sha2.h
> >> sha2.o: sha2.c sha2.h
> >>
> >> So I had to tell it the C files. I can't do *.c, as there are 259 other
> >> .c files in the folder.
> >
> > What you do is use the -MMD option of gcc which causes it
> > to compile regularly while writing the dependency information to
> > a .d file.
> >
> > These .d files are included into the Makefile (using -include
> > so that the include doesn't fail when they don't yet exist).
> >
> > When a project is newly compiled from a clean state, dependencies
> > are not required because everything must be built.
> >
> > After the first full build, you then have the .d files.
> >
> > It's a far from perfect solution. One problem is that when you make a
> > change that removes a header file, the build breaks, due to a missing
> > dependency. The dependency can't be fixed automatically because make
> > wont't run the rule which does that. You either clean away all the
> > dependencies, or if you don't want to suffer the rebuild time, you have
> > to hunt down all the .d files which mention the removed header and blow
> > those off.
> >
>
> You can do better than that. You can generate dependency rules for the
> dependency files. My makefile has a rule template that is run for each
> source directory. Part of that includes:
>
>
> define compile_rule_template
> # $(1) = directory
> # $(2) = extra common flags
> # $(3) = extra c flags
> # $(4) = extra cpp flags
>
> # First, rules to generate target directories as needed
> $(dep_dir)$(1) $(obj_dir)$(1) $(lst_dir)$(1) :
> $(MKDIR) -p $$@
>
> # Generate dependancy files
> $(dep_dir)$(1)%.d : $(1)%.c $(alldepends) | $(dep_dir)$(1)
> @echo Generating depency file $$@
> $(CCDEP) $(combined_cflags) $(2) $(3) -MM -MP \
> -MT $(obj_dir)$(1)$$(@F:%.d=%.o) -MT \
> $(dep_dir)$(1)$$(@F:%.o=%.o) \
> -MF $$@ $$<
>
>
>
> I'll let you look up the gcc manual and make manual for the details of
> how this all works. It generates the dependency files automatically,
> and updates them automatically. Obviously you need to set the variables
> referenced, so that your object files and dependency files are in
> separate trees from the source files.
>
> I was a little reluctant to post this because Bart will get his knickers
> in a twist over it, but you might find it useful or inspirational.
>
As professional software engineers we ought to be able to do better
than this sort of thing.

Re: you think rust may *DE*throne c?

<ub7p59$1a1uf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27509&group=comp.lang.c#27509

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Sat, 12 Aug 2023 12:07:21 +0100
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <ub7p59$1a1uf$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<ub4lb2$olm3$1@dont-email.me> <ub51sl$qadl$1@dont-email.me>
<BLqBM.109943$8_8a.102743@fx48.iad>
<f14ccbd8-201f-4aea-9be3-64601766f044n@googlegroups.com>
<hCsBM.562404$AsA.500972@fx18.iad> <ub5oio$tmpp$1@dont-email.me>
<ub5rgt$u502$1@dont-email.me> <20230811143115.205@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 12 Aug 2023 11:07:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8f8ff97ceeaa08bdbf0dfaaf05e17a26";
logging-data="1378255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hbUm962JHE7o0baiZa2bu9R4Jen6DoEI="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:jOwP2CfaGg8XLvyIkDoC+TgKSzI=
In-Reply-To: <20230811143115.205@kylheku.com>
 by: Bart - Sat, 12 Aug 2023 11:07 UTC

On 11/08/2023 22:38, Kaz Kylheku wrote:
> On 2023-08-11, Bart <bc@freeuk.com> wrote:
>> Now, please tell me what is the point of creating a subdirectory to
>> contain only the one file. Or indeed, what is the point of using 'make'
>> in this case.
>
> If you don't see a technical point of using make in a certain situation,
> there almost certainly isn't one.
>
> Sometimes people write Makefiles (or follow other conventions) simply
> to be compatible wth a common convention.
>
> If you're writing code for an audience which expects to build
> a program similarly to this:
>
> $ ./configure && make && make install

Such an audience is a lost cause.

I mean, what exactly are we building here, anyway? Is it A, B, or Z?
That's a rather important detail!

Long ago, I used independent compilation just like C still does. So it
happened that sometimes you made a change in a project that required
compiling all modules rather than the one you'd just edited.

However, this was easy to deal with: the structure of my apps was
simple: all modules shared the same project-wide header files (this not
for C):

So, any edits to a module only required compilation of that module.

Any edits to a header in general required compiling everything. But
since I was very familiar with a project because I could spend years on
one, I could usually tell exactly what needed to be recompiled.

In any case, compiling one module took some fraction of a second,
recompiling everything might take several seconds. It wasn't a big deal.

So, there was no need for an automatic tool that discovers dependencies.
The main dependencies I already know about. If I forget to do a
full-recompile, I will quickly find out.

I've also used a basic IDE for development right from the start (early
80s). This used a project file to list the modules of an application, to
simplify browsing and editing (and early versions had a resident
compiler and editor to streamline things on floppy-based systems).

I still use an IDE for my apps. But my compilers can run happily from a
command line, for example this script builds a new production version of
my C compiler:

mm -opt cc.m
copy cc.exe \m\bcc.exe

Or I can try to make bcc compile 'itself' (since it's not written in C):

c:\cx>g:\marchive\mxc\mc -c cc # (archived tool)
M6 Compiling cc.m---------- to cc.c

c:\cx>bcc cc
Compiling cc.c to cc.exe

c:\cx>cc cc -out:cc2 # run on itself again
Compiling cc.c to cc2.exe

c:\cx>cc2 -run hello
Compiling hello.c to hello.exe
Hello, World!

(Try this with gcc.)

So you can see there is no need for 'make', or special rules as to what
I can have in my directories. Or the need for dependencies to minimise
compilation, given that all my apps take a fraction of a second to build
from scratch.

As for that 'configure &&' business; I assume C developers know how to
directly build 'hello.c' using an actual compiler? If so, they can build
one of my C applications.

If they don't, then then they will trouble running my apps anyway.

Re: you think rust may *DE*throne c?

<ub7pf0$1a1uf$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27510&group=comp.lang.c#27510

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Sat, 12 Aug 2023 12:12:32 +0100
Organization: A noiseless patient Spider
Lines: 94
Message-ID: <ub7pf0$1a1uf$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<20230809091709.678@kylheku.com> <ub7ga2$18t8e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 12 Aug 2023 11:12:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8f8ff97ceeaa08bdbf0dfaaf05e17a26";
logging-data="1378255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Znk4cZMgq5TxGhX9zwgDuf1JWNqH0WaU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:jP1NVLOPkVyWWI8DMXAgmxlF280=
In-Reply-To: <ub7ga2$18t8e$1@dont-email.me>
 by: Bart - Sat, 12 Aug 2023 11:12 UTC

On 12/08/2023 09:36, David Brown wrote:
> On 09/08/2023 18:34, Kaz Kylheku wrote:
>> On 2023-08-09, Bart <bc@freeuk.com> wrote:
>>> On 09/08/2023 14:32, Richard Harnden wrote:
>>>> On 09/08/2023 13:32, Bart wrote:
>>>>> Yes, that is one reason that it is so complicated. You have to define
>>>>> set of dependences between modules (and you may need to do that
>>>>> manually, so it can be error prone).
>>>>
>>>> $ gcc -MM *.c
>>>
>>> I have a small, 3-file project (one of Chris's) comprising files
>>> cipher.c, sha2.c, hmac.c
>>>
>>> gcc -MM cipher.c outputs:
>>>
>>>     cipher.o: cipher.c hmac.c sha2.h
>>>
>>> I need to do -MM cipher.c hmac.c sha2.c for it to show:
>>>
>>>     cipher.o: cipher.c hmac.h sha2.h
>>>     hmac.o: hmac.c hmac.h sha2.h
>>>     sha2.o: sha2.c sha2.h
>>>
>>> So I had to tell it the C files. I can't do *.c, as there are 259 other
>>> .c files in the folder.
>>
>> What you do is use the -MMD option of gcc which causes it
>> to compile regularly while writing the dependency information to
>> a .d file.
>>
>> These .d files are included into the Makefile (using -include
>> so that the include doesn't fail when they don't yet exist).
>>
>> When a project is newly compiled from a clean state, dependencies
>> are not required because everything must be built.
>>
>> After the first full build, you then have the .d files.
>>
>> It's a far from  perfect solution. One problem is that when you make a
>> change that removes a header file, the build breaks, due to a missing
>> dependency. The dependency can't be fixed automatically because make
>> wont't run the rule which does that. You either clean away all the
>> dependencies, or if you don't want to suffer the rebuild time, you have
>> to hunt down all the .d files which mention the removed header and blow
>> those off.
>>
>
> You can do better than that.  You can generate dependency rules for the
> dependency files.  My makefile has a rule template that is run for each
> source directory.  Part of that includes:
>
>
> define compile_rule_template
>   # $(1) = directory
>   # $(2) = extra common flags
>   # $(3) = extra c flags
>   # $(4) = extra cpp flags
>
>   # First, rules to generate target directories as needed
>   $(dep_dir)$(1) $(obj_dir)$(1) $(lst_dir)$(1) :
>         $(MKDIR) -p $$@
>
>   # Generate dependancy files
>   $(dep_dir)$(1)%.d : $(1)%.c $(alldepends) | $(dep_dir)$(1)
>         @echo Generating depency file $$@
>         $(CCDEP) $(combined_cflags) $(2) $(3) -MM -MP \
>                         -MT $(obj_dir)$(1)$$(@F:%.d=%.o) -MT \
>                         $(dep_dir)$(1)$$(@F:%.o=%.o) \
>                         -MF $$@ $$<
>
>
>
> I'll let you look up the gcc manual and make manual for the details of
> how this all works.  It generates the dependency files automatically,
> and updates them automatically.  Obviously you need to set the variables
> referenced, so that your object files and dependency files are in
> separate trees from the source files.
>
> I was a little reluctant to post this because Bart will get his knickers
> in a twist over it, but you might find it useful or inspirational.

Yeah, more likely to put people off for life.

Suppose you dispensed with all that dependency stuff; how long would it
take to build such a project? Say compared with just compiling one module.

My other recent post suggests that someone very familiar with their
application, will soon know which modules need to be recompiled after
any change. That is, if a full recompile takes too long.

Re: you think rust may *DE*throne c?

<2c56d7cf-cf92-4295-9273-2fbc25df3a2bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27514&group=comp.lang.c#27514

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7d92:0:b0:403:c200:cd07 with SMTP id c18-20020ac87d92000000b00403c200cd07mr65253qtd.4.1691853668655;
Sat, 12 Aug 2023 08:21:08 -0700 (PDT)
X-Received: by 2002:a17:902:e5c2:b0:1b8:2055:fc1f with SMTP id
u2-20020a170902e5c200b001b82055fc1fmr1998170plf.2.1691853668068; Sat, 12 Aug
2023 08:21:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 12 Aug 2023 08:21:07 -0700 (PDT)
In-Reply-To: <20230811122917.667@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.243; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.243
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk>
<ub1840$3q1k$1@dont-email.me> <87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
<20230810090521.27@kylheku.com> <UKVPuuMp3KUo8mPWS@bongo-ra.co>
<20230810230301.714@kylheku.com> <2KqBM.109942$8_8a.102233@fx48.iad> <20230811122917.667@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c56d7cf-cf92-4295-9273-2fbc25df3a2bn@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 12 Aug 2023 15:21:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4258
 by: fir - Sat, 12 Aug 2023 15:21 UTC

piątek, 11 sierpnia 2023 o 21:41:41 UTC+2 Kaz Kylheku napisał(a):
> On 2023-08-11, Scott Lurndal <sc...@slp53.sl.home> wrote:
> > Kaz Kylheku <864-11...@kylheku.com> writes:
> >>On 2023-08-11, Spiros Bousbouras <spi...@gmail.com> wrote:
> >>> On Thu, 10 Aug 2023 16:15:32 -0000 (UTC)
> >>> Kaz Kylheku <864-11...@kylheku.com> wrote:
> >>>> What we could have is that an executable just dynamically links to
> >>>> functions in these libraries, and the system automatically finds them at
> >>>> load time, without the executable having to specify which libraries. >>>
> >>> And how is your scheme different than how it already works in the Unix
> >>> world ?
> >>
> >>How it differs is that the executable has to nominate the specific
> >>libraries by indicating the library, which came in via the -l option,
> >>and then look for specific symbols from specific libraries that it has
> >>attached.
> >>
> >>Under the hood, the semantics is much like dlopen() of specific
> >>liraries to obtain a handle and then doing dlsym(handle, "name")
> >>to look for specific names from specific libs.
> >>
> >>Imagine it could specify just symbols, without specifying where
> >>they come from; that's a big difference.
> >
> > Would this not require that no symbol be present in more than
> > one library, i.e. that there is a single symbol namespace across the
> > entire system?
> >
> > That would seem to be a non-starter.
> I sort of addressed that in the parts that were snipped above.
> We also have the problem that multiple versions of the same library
> can exist (or multiple version nodes within the same library).
>

versioning is a problem, i recently wrota a thought that given dll should be versioned by letters not numbers , most probably by\ig letters like version "A"
means some interface when lib is upbuild and shipped most rpbably it should contain "A B" strings meaning it conform to both "A" and "B" when "A" interface would stay but work slightly different it probably can be "A2 B"

i think its not bad as people working on dll probably would think if to add new
official version and its letter, also shoudl be aware that what they name "A"
is officially only what they named "A" and new added unoficcialy functions
between "A" and "B" are unoficcial

this is imo easy way to tame that great potential chaos...
(also they should be avare not to break "A" unles they want and then delete "A"
string)

Re: you think rust may outthrone c?

<86r0o887op.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27516&group=comp.lang.c#27516

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 12 Aug 2023 10:57:42 -0700
Organization: A noiseless patient Spider
Lines: 115
Message-ID: <86r0o887op.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <u9e1v9$38vf8$1@dont-email.me> <u9e4bh$39ff2$1@dont-email.me> <u9e8so$3addm$1@dont-email.me> <u9edc7$3bdu0$1@dont-email.me> <u9em5t$3d7sv$1@dont-email.me> <875y6dne2u.fsf@nosuchdomain.example.com> <u9evak$3eutv$1@dont-email.me> <3ff53ffd-299b-4dc8-a503-cfd170ce3e03n@googlegroups.com> <u9gbnu$3pc9g$1@dont-email.me> <u9h29k$3ssnr$1@dont-email.me> <u9hob6$3vo3c$1@dont-email.me> <u9jig1$9lnb$2@dont-email.me> <u9jm4i$a4dp$1@dont-email.me> <u9jqnf$ak1k$1@dont-email.me> <u9juf1$avv8$1@dont-email.me> <u9lafa$j89a$1@dont-email.me> <u9li0r$k6vn$1@dont-email.me> <87ila9laoa.fsf@bsb.me.uk> <86cz0fs86n.fsf@linuxsc.com> <87pm4fqppe.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="744b704e16faf359564fcd4001f85eba";
logging-data="1535444"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6A2ZK20eKphxy82ldGei9zaIcYsb//wA="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:LqxMDFSSz9wlwyg/DeEshUhFP88=
sha1:DxFBvTs/KX1PIZsrXuJvkiJjRv0=
 by: Tim Rentsch - Sat, 12 Aug 2023 17:57 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
> [...]
>
>>> Yes, C++ calls them literals. But that site does use the same
>>> terminology as the C standard when talking about C:
>>>
>>> https://en.cppreference.com/w/c/language/integer_constant
>>>
>>> I prefer C++'s usage, since "integer constant" can be so easily
>>> confused for "integer constant expression".
>>
>> Using the same term for both suggests a false equivalence, and
>> also is ahistorical. The two kinds of entities are fundamentally
>> different: constants denote values, literals denote objects.
>> Constants, like mathematical constants, always denote the same
>> value; literals denote different objects at different times or
>> places, even if the values used to produce a given literal are
>> always the same, which they need not be. The distinctions are
>> too important to gloss over by using a common term for both.
>
> When you say that "literals denote objects", are you referring
> specifically to the way C uses the terms "string literal" and
> "compound literal"?
>
> I haven't done an exhaustive search, but every language other than
> C whose documentation I've just checked (C++, Ada, Perl, Python,
> Go, Java) calls 42 an integer literal and "foo" a string literal.
> C is a bit of an outlier in callling 42 an integer constant.
>
> I suggest that the fact that C uses "constant" for tokens that
> refer to values and "literal" (string or compound) for constructs
> that refer to anonymous objects was an arbitrary choice, and the
> distinction you mention is not nearly as fundamental as you
> suggest it is.
>
> I do prefer to use the term "integer constant" when discussing C,
> but the phrase "integer literal" is (a) correct in most other
> languages and (b) perfectly clear. It wouldn't occur to me that
> "integer literal" implies something that refers to an object.

The word literal, used as a noun when describing programming
languages, came into vogue sometime after it became common to
specify language syntax by using a formal grammar (usually
expressed in some variation of Backus-Naur Form); roughly the
1970s timeframe. A typical usage would be for "literal" to be
synonymous with "terminal symbol", or perhaps with just a subset
of terminal symbols, as used in the rules of grammar. In some
cases the words "constant" and "literal" were used more or less
interchangeably.

A good decade earlier, however, the word literal was used in a
somewhat different programming language context, not as part of
describing a language but as an element of the language. The
assembly language for IBM System/360 had constants, both ordinary
numeric and character constants, and symbolic constants (defined
with EQU). Constants could be used as direct operands for some
instructions, depending on the particulars of the instruction and
for which operand, and represented values encoded directly in the
instruction. Distinct from constants there were also /literals/,
a distinct category of operand that produced the address of an
initialized anonymous region of memory. Here are two example
lines of assembly, to illustrate the difference:

OI VAL+2,X'F0'
C 3,=F'1000'

In the first line, there are two constants, 2 and X'F0'. These
tokens are numerical quantities that are used directly in the
generated instruction. (In the case of the constant 2 the value
is added to the address VAL, and it is the sum that is used to
produce the bytes of the instruction, but the key property is
that the value 2 participates locally, and not remotely.)

The second line has a constant 3 and a literal =F'1000'. Like in
the first line, the value 3 is used directly in the generated
instruction. The literal =F'1000' is not used directly. Instead,
the assembler keeps track of literals used in the program, and
uses them to initialize areas of memory elsewhere in the program.
A use of a literal, such as the =F'1000' here, results in the
address of the memory area reserved for the value of the literal.
(There are some further details about literals, such as literal
pools and the LTORG directive, that I won't explain because those
details are not important to the discussion.)

Note the parallels between how these terms are used in assembly
language and in C. Constants are used to generate code but appear
only implicitly; literals always occupy areas of memory (objects)
and use of a literal causes its address (lvalue) to be part of a
generated instruction. The distinction between constants and
literals is primarily a semantic distinction, not a syntactic one.

Besides being more historically faithful, having two different
terms provides a useful semantic distinction that would disappear
if the term "literal" were used for both concepts.

>> Given a choice between the level of confusion seen in the C++
>> standard and the level of confusion seen in the C standard ("integer
>> constant" and "integer constant expression" is confusing? really?)
>> I'm happy to be on the side of C's choice any day of the week and
>> twice on Sunday. Please cast my vote to continue using the terms
>> "constant" and "literal" as they are used in the C standard.
>
> I use those terms simply because that's how they're used in the C
> standard.

Obviously it's a good idea to use terminology in the C standard
when talking about the C language. My point though is that the
terminology used in the C standard is a better choice both
historically and semantically.

Re: you think rust may *DE*throne c?

<ee53491a-3aae-49d8-bd57-4a2a82a4d152n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27517&group=comp.lang.c#27517

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:4c1b:b0:63c:fe6e:bb4 with SMTP id qh27-20020a0562144c1b00b0063cfe6e0bb4mr61402qvb.0.1691864049626;
Sat, 12 Aug 2023 11:14:09 -0700 (PDT)
X-Received: by 2002:a63:77c2:0:b0:563:8d36:5d8a with SMTP id
s185-20020a6377c2000000b005638d365d8amr1057874pgc.3.1691864049328; Sat, 12
Aug 2023 11:14:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 12 Aug 2023 11:14:08 -0700 (PDT)
In-Reply-To: <2c56d7cf-cf92-4295-9273-2fbc25df3a2bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.208; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.208
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad> <e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me> <87bkffg6qz.fsf@bsb.me.uk>
<ub1840$3q1k$1@dont-email.me> <87zg2zej54.fsf@bsb.me.uk> <Hr6BM.359405$xMqa.20823@fx12.iad>
<87il9ndiz9.fsf@bsb.me.uk> <HJ7BM.25894$Wk53.19314@fx01.iad>
<20230810090521.27@kylheku.com> <UKVPuuMp3KUo8mPWS@bongo-ra.co>
<20230810230301.714@kylheku.com> <2KqBM.109942$8_8a.102233@fx48.iad>
<20230811122917.667@kylheku.com> <2c56d7cf-cf92-4295-9273-2fbc25df3a2bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ee53491a-3aae-49d8-bd57-4a2a82a4d152n@googlegroups.com>
Subject: Re: you think rust may *DE*throne c?
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 12 Aug 2023 18:14:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 12 Aug 2023 18:14 UTC

sobota, 12 sierpnia 2023 o 17:21:15 UTC+2 fir napisał(a):
> piątek, 11 sierpnia 2023 o 21:41:41 UTC+2 Kaz Kylheku napisał(a):
> > On 2023-08-11, Scott Lurndal <sc...@slp53.sl.home> wrote:
> > > Kaz Kylheku <864-11...@kylheku.com> writes:
> > >>On 2023-08-11, Spiros Bousbouras <spi...@gmail.com> wrote:
> > >>> On Thu, 10 Aug 2023 16:15:32 -0000 (UTC)
> > >>> Kaz Kylheku <864-11...@kylheku.com> wrote:
> > >>>> What we could have is that an executable just dynamically links to
> > >>>> functions in these libraries, and the system automatically finds them at
> > >>>> load time, without the executable having to specify which libraries. >>>
> > >>> And how is your scheme different than how it already works in the Unix
> > >>> world ?
> > >>
> > >>How it differs is that the executable has to nominate the specific
> > >>libraries by indicating the library, which came in via the -l option,
> > >>and then look for specific symbols from specific libraries that it has
> > >>attached.
> > >>
> > >>Under the hood, the semantics is much like dlopen() of specific
> > >>liraries to obtain a handle and then doing dlsym(handle, "name")
> > >>to look for specific names from specific libs.
> > >>
> > >>Imagine it could specify just symbols, without specifying where
> > >>they come from; that's a big difference.
> > >
> > > Would this not require that no symbol be present in more than
> > > one library, i.e. that there is a single symbol namespace across the
> > > entire system?
> > >
> > > That would seem to be a non-starter.
> > I sort of addressed that in the parts that were snipped above.
> > We also have the problem that multiple versions of the same library
> > can exist (or multiple version nodes within the same library).
> >
> versioning is a problem, i recently wrota a thought that given dll should be versioned by letters not numbers , most probably by\ig letters like version "A"
> means some interface when lib is upbuild and shipped most rpbably it should contain "A B" strings meaning it conform to both "A" and "B" when "A" interface would stay but work slightly different it probably can be "A2 B"
>
> i think its not bad as people working on dll probably would think if to add new
> official version and its letter, also shoudl be aware that what they name "A"
> is officially only what they named "A" and new added unoficcialy functions
> between "A" and "B" are unoficcial
>
> this is imo easy way to tame that great potential chaos...
> (also they should be avare not to break "A" unles they want and then delete "A"
> string)

still this wersioning could be a pain imo... there could be probably a tool
some "version guerd" that you could maybe use to set a version like

version_guard green.fire.dll "A"

that will add an "A" versioning to a given dll and produces something like
header/certyficate to be able to guard "A" interface from changes just not lett it
be changed (it could or maybe even should be build in compiler)

maybe that would help

there is also a problem of preserving interface (which may be guarded somewhat programatically) and guard the exact efects of how it work - as you can have "A"
interface and quite different work (as i said i rather see this versions should be named by arabic numbers)..im not sure how compiler could quard the second thing (partially it could - by assuming all branches below "A" interface should
ask programmer if some changes there for sure not violate the behaviur
-and if do they should note it is not compatible to arabic number and at another versioning chnge the arabic number)

this is all pain but imo seems better what there is now

Re: you think rust may outthrone c?

<87350nomsc.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27524&group=comp.lang.c#27524

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Sat, 12 Aug 2023 16:37:07 -0700
Organization: None to speak of
Lines: 143
Message-ID: <87350nomsc.fsf@nosuchdomain.example.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u9e4bh$39ff2$1@dont-email.me> <u9e8so$3addm$1@dont-email.me>
<u9edc7$3bdu0$1@dont-email.me> <u9em5t$3d7sv$1@dont-email.me>
<875y6dne2u.fsf@nosuchdomain.example.com>
<u9evak$3eutv$1@dont-email.me>
<3ff53ffd-299b-4dc8-a503-cfd170ce3e03n@googlegroups.com>
<u9gbnu$3pc9g$1@dont-email.me> <u9h29k$3ssnr$1@dont-email.me>
<u9hob6$3vo3c$1@dont-email.me> <u9jig1$9lnb$2@dont-email.me>
<u9jm4i$a4dp$1@dont-email.me> <u9jqnf$ak1k$1@dont-email.me>
<u9juf1$avv8$1@dont-email.me> <u9lafa$j89a$1@dont-email.me>
<u9li0r$k6vn$1@dont-email.me> <87ila9laoa.fsf@bsb.me.uk>
<86cz0fs86n.fsf@linuxsc.com> <87pm4fqppe.fsf@nosuchdomain.example.com>
<86r0o887op.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="29fc9fb73f69921da02d2ab046f19f8d";
logging-data="1629625"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vwlF+hXb9rd+YtQacFU51"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:pjXP4H7f4CNDkO3zHa7J5srYfIo=
sha1:/d1xIihFGDBJltwY6+tkgiCxl+s=
 by: Keith Thompson - Sat, 12 Aug 2023 23:37 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>> [...]
>>>> Yes, C++ calls them literals. But that site does use the same
>>>> terminology as the C standard when talking about C:
>>>>
>>>> https://en.cppreference.com/w/c/language/integer_constant
>>>>
>>>> I prefer C++'s usage, since "integer constant" can be so easily
>>>> confused for "integer constant expression".
>>>
>>> Using the same term for both suggests a false equivalence, and
>>> also is ahistorical. The two kinds of entities are fundamentally
>>> different: constants denote values, literals denote objects.
>>> Constants, like mathematical constants, always denote the same
>>> value; literals denote different objects at different times or
>>> places, even if the values used to produce a given literal are
>>> always the same, which they need not be. The distinctions are
>>> too important to gloss over by using a common term for both.
>>
>> When you say that "literals denote objects", are you referring
>> specifically to the way C uses the terms "string literal" and
>> "compound literal"?
>>
>> I haven't done an exhaustive search, but every language other than
>> C whose documentation I've just checked (C++, Ada, Perl, Python,
>> Go, Java) calls 42 an integer literal and "foo" a string literal.
>> C is a bit of an outlier in callling 42 an integer constant.
>>
>> I suggest that the fact that C uses "constant" for tokens that
>> refer to values and "literal" (string or compound) for constructs
>> that refer to anonymous objects was an arbitrary choice, and the
>> distinction you mention is not nearly as fundamental as you
>> suggest it is.
>>
>> I do prefer to use the term "integer constant" when discussing C,
>> but the phrase "integer literal" is (a) correct in most other
>> languages and (b) perfectly clear. It wouldn't occur to me that
>> "integer literal" implies something that refers to an object.
>
> The word literal, used as a noun when describing programming
> languages, came into vogue sometime after it became common to
> specify language syntax by using a formal grammar (usually
> expressed in some variation of Backus-Naur Form); roughly the
> 1970s timeframe. A typical usage would be for "literal" to be
> synonymous with "terminal symbol", or perhaps with just a subset
> of terminal symbols, as used in the rules of grammar. In some
> cases the words "constant" and "literal" were used more or less
> interchangeably.
>
> A good decade earlier, however, the word literal was used in a
> somewhat different programming language context, not as part of
> describing a language but as an element of the language. The
> assembly language for IBM System/360 had constants, both ordinary
> numeric and character constants, and symbolic constants (defined
> with EQU). Constants could be used as direct operands for some
> instructions, depending on the particulars of the instruction and
> for which operand, and represented values encoded directly in the
> instruction. Distinct from constants there were also /literals/,
> a distinct category of operand that produced the address of an
> initialized anonymous region of memory. Here are two example
> lines of assembly, to illustrate the difference:
>
> OI VAL+2,X'F0'
> C 3,=F'1000'
>
> In the first line, there are two constants, 2 and X'F0'. These
> tokens are numerical quantities that are used directly in the
> generated instruction. (In the case of the constant 2 the value
> is added to the address VAL, and it is the sum that is used to
> produce the bytes of the instruction, but the key property is
> that the value 2 participates locally, and not remotely.)
>
> The second line has a constant 3 and a literal =F'1000'. Like in
> the first line, the value 3 is used directly in the generated
> instruction. The literal =F'1000' is not used directly. Instead,
> the assembler keeps track of literals used in the program, and
> uses them to initialize areas of memory elsewhere in the program.
> A use of a literal, such as the =F'1000' here, results in the
> address of the memory area reserved for the value of the literal.
> (There are some further details about literals, such as literal
> pools and the LTORG directive, that I won't explain because those
> details are not important to the discussion.)
>
> Note the parallels between how these terms are used in assembly
> language and in C. Constants are used to generate code but appear
> only implicitly; literals always occupy areas of memory (objects)
> and use of a literal causes its address (lvalue) to be part of a
> generated instruction. The distinction between constants and
> literals is primarily a semantic distinction, not a syntactic one.
>
> Besides being more historically faithful, having two different
> terms provides a useful semantic distinction that would disappear
> if the term "literal" were used for both concepts.
>
>
>>> Given a choice between the level of confusion seen in the C++
>>> standard and the level of confusion seen in the C standard ("integer
>>> constant" and "integer constant expression" is confusing? really?)
>>> I'm happy to be on the side of C's choice any day of the week and
>>> twice on Sunday. Please cast my vote to continue using the terms
>>> "constant" and "literal" as they are used in the C standard.
>>
>> I use those terms simply because that's how they're used in the C
>> standard.
>
> Obviously it's a good idea to use terminology in the C standard
> when talking about the C language. My point though is that the
> terminology used in the C standard is a better choice both
> historically and semantically.

Ok, that's some interesting history -- but I've never heard of anything
other than IBM System/360 assembly language (and C) that makes that
particular distinction. Most programmers these days (myself included)
are not more than vaguely familiar with System/360.

The distinction you suggest never occurred to me until you brought it up
here. (The term "string literal" appears to have been introduced in
K&R1, 1978; earlier documents use the term "string". All C documents
I've checked back to 1975 refer to integer, character, and floating
constants as "constants". B did the same. BCPL used the term "string
constant".)

Do you have other examples, or evidence that the distinction between
"literals" and "constants" has been common?

On the other hand, multiple modern languages use "literal" to refer
to what C calls "constants". I know that C only uses "literal"
to refer to string literals and compound literals, but I never
perceived any implication that a "literal" is something that refers
to an object. (And I'd have no problem if a future C standard
adopted the word "literal" for what it now calls "constants".)

A question for the group: does anyone else perceive this general
distinction between "constant" (denoting a value) and "literal"
(denoting an object)?

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: you think rust may *DE*throne c?

<ub9ski$1nr07$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27528&group=comp.lang.c#27528

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may *DE*throne c?
Date: Sun, 13 Aug 2023 08:18:58 +0200
Organization: A noiseless patient Spider
Lines: 103
Message-ID: <ub9ski$1nr07$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<uaavm0$3ln4f$1@dont-email.me> <uab5ja$3mc91$1@dont-email.me>
<uabeq1$3nigh$1@dont-email.me> <uabobj$3oias$1@dont-email.me>
<uaduf0$54pp$1@dont-email.me> <uajaqg$1bc41$4@dont-email.me>
<uajfq3$1cesi$1@dont-email.me> <uat7t4$3cco6$1@dont-email.me>
<uat9ca$3cjmt$1@dont-email.me> <uatjcp$3ec7b$1@dont-email.me>
<uatlrr$3epln$1@dont-email.me> <uatr2m$3fla4$1@dont-email.me>
<909acf23-ef0e-44c7-9ebf-89846e50e871n@googlegroups.com>
<p_uAM.489417$mPI2.398490@fx15.iad>
<e5d7b49e-3472-4b70-8c52-d21243725d15n@googlegroups.com>
<87zg31ezu5.fsf@bsb.me.uk> <uavpcf$3t64r$1@dont-email.me>
<slrnud6spf.f45.dan@djph.net> <ub010k$3um69$1@dont-email.me>
<ub04i1$3v4p5$2@dont-email.me> <ub06ih$3vdv6$1@dont-email.me>
<20230809091709.678@kylheku.com> <ub7ga2$18t8e$1@dont-email.me>
<44305fed-5f5f-47b8-84e9-5ca042767742n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 06:18:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e910e93216fe9fc7cc476e41f23ee47d";
logging-data="1829895"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1940P/ay3CZSYoqZtqGmp2sevxKVanxq3s="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:8NEk7zzUnor4kTWyZ2nWFHqRu48=
In-Reply-To: <44305fed-5f5f-47b8-84e9-5ca042767742n@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Sun, 13 Aug 2023 06:18 UTC

On 12/08/2023 11:58, Malcolm McLean wrote:
> On Saturday, 12 August 2023 at 09:36:35 UTC+1, David Brown wrote:
>> On 09/08/2023 18:34, Kaz Kylheku wrote:
>>> On 2023-08-09, Bart <b...@freeuk.com> wrote:
>>>> On 09/08/2023 14:32, Richard Harnden wrote:
>>>>> On 09/08/2023 13:32, Bart wrote:
>>>>>> Yes, that is one reason that it is so complicated. You have to define
>>>>>> set of dependences between modules (and you may need to do that
>>>>>> manually, so it can be error prone).
>>>>>
>>>>> $ gcc -MM *.c
>>>>
>>>> I have a small, 3-file project (one of Chris's) comprising files
>>>> cipher.c, sha2.c, hmac.c
>>>>
>>>> gcc -MM cipher.c outputs:
>>>>
>>>> cipher.o: cipher.c hmac.c sha2.h
>>>>
>>>> I need to do -MM cipher.c hmac.c sha2.c for it to show:
>>>>
>>>> cipher.o: cipher.c hmac.h sha2.h
>>>> hmac.o: hmac.c hmac.h sha2.h
>>>> sha2.o: sha2.c sha2.h
>>>>
>>>> So I had to tell it the C files. I can't do *.c, as there are 259 other
>>>> .c files in the folder.
>>>
>>> What you do is use the -MMD option of gcc which causes it
>>> to compile regularly while writing the dependency information to
>>> a .d file.
>>>
>>> These .d files are included into the Makefile (using -include
>>> so that the include doesn't fail when they don't yet exist).
>>>
>>> When a project is newly compiled from a clean state, dependencies
>>> are not required because everything must be built.
>>>
>>> After the first full build, you then have the .d files.
>>>
>>> It's a far from perfect solution. One problem is that when you make a
>>> change that removes a header file, the build breaks, due to a missing
>>> dependency. The dependency can't be fixed automatically because make
>>> wont't run the rule which does that. You either clean away all the
>>> dependencies, or if you don't want to suffer the rebuild time, you have
>>> to hunt down all the .d files which mention the removed header and blow
>>> those off.
>>>
>>
>> You can do better than that. You can generate dependency rules for the
>> dependency files. My makefile has a rule template that is run for each
>> source directory. Part of that includes:
>>
>>
>> define compile_rule_template
>> # $(1) = directory
>> # $(2) = extra common flags
>> # $(3) = extra c flags
>> # $(4) = extra cpp flags
>>
>> # First, rules to generate target directories as needed
>> $(dep_dir)$(1) $(obj_dir)$(1) $(lst_dir)$(1) :
>> $(MKDIR) -p $$@
>>
>> # Generate dependancy files
>> $(dep_dir)$(1)%.d : $(1)%.c $(alldepends) | $(dep_dir)$(1)
>> @echo Generating depency file $$@
>> $(CCDEP) $(combined_cflags) $(2) $(3) -MM -MP \
>> -MT $(obj_dir)$(1)$$(@F:%.d=%.o) -MT \
>> $(dep_dir)$(1)$$(@F:%.o=%.o) \
>> -MF $$@ $$<
>>
>>
>>
>> I'll let you look up the gcc manual and make manual for the details of
>> how this all works. It generates the dependency files automatically,
>> and updates them automatically. Obviously you need to set the variables
>> referenced, so that your object files and dependency files are in
>> separate trees from the source files.
>>
>> I was a little reluctant to post this because Bart will get his knickers
>> in a twist over it, but you might find it useful or inspirational.
>>
> As professional software engineers we ought to be able to do better
> than this sort of thing.
>

Possibly. But most of the attempts, such as CMake, have not been as
good. They have tried to have a less cryptic syntax, but either fail to
provide the features needed, or simply replace cryptic symbols with
cryptic words.

Part of it is the flexibility needed - what suits me in my projects is
not the same as what suits other people in their projects.

The reality of good makefiles is that you don't spend much time on them.
I might spend a few hours on a project tweaking or modifying the
makefile I use, copied from a previous project. It's a tiny, tiny
fraction of the effort in a development project, and it makes things
much more efficient, portable, and easy to replicate - I am used to
rebuilding projects with bit-perfect replication on computers a decade
apart with different OS's. The effort required to google for "automatic
dependency generation for makefiles" and copy the ideas is small.


devel / comp.lang.c / Re: you think rust may *DE*throne c?

Pages:123456789101112131415161718192021222324252627282930313233343536373839
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor