Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Play Rogue, visit exotic locations, meet strange creatures and kill them.


devel / comp.lang.c / Re: Baby X resource compiler nearly ready

SubjectAuthor
* Baby X resource compiler nearly readyMalcolm McLean
+* Re: Baby X resource compiler nearly readyfir
|+* Re: Baby X resource compiler nearly readyfir
||`- Re: Baby X resource compiler nearly readyMalcolm McLean
|`* Re: Baby X resource compiler nearly readyMalcolm McLean
| +* Re: Baby X resource compiler nearly readyfir
| |`* Re: Baby X resource compiler nearly readyMalcolm McLean
| | `* Re: Baby X resource compiler nearly readyfir
| |  `- Re: Baby X resource compiler nearly readyfir
| +- Re: Baby X resource compiler nearly readyfir
| `* Re: Baby X resource compiler nearly readyBen Bacarisse
|  `- Re: Baby X resource compiler nearly readyMalcolm McLean
+* Re: Baby X resource compiler nearly readyBen Bacarisse
|`* Re: Baby X resource compiler nearly readyMalcolm McLean
| `* Re: Baby X resource compiler nearly readyBen Bacarisse
|  +* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |`* Re: Baby X resource compiler nearly readyBen Bacarisse
|  | `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |  `* Re: Baby X resource compiler nearly readyKenny McCormack
|  |   `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |    +* Re: Baby X resource compiler nearly readySpiros Bousbouras
|  |    |+* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |    ||+* Re: Baby X resource compiler nearly readyKenny McCormack
|  |    |||`* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |    ||| +* Re: Baby X resource compiler nearly readyKenny McCormack
|  |    ||| |+- Re: Baby X resource compiler nearly readyBart
|  |    ||| |`- Re: Baby X resource compiler nearly readyKaz Kylheku
|  |    ||| +* Re: Baby X resource compiler nearly readyDavid Brown
|  |    ||| |`* Re: Baby X resource compiler nearly readyKeith Thompson
|  |    ||| | +- Re: Baby X resource compiler nearly readyKeith Thompson
|  |    ||| | `- Re: Baby X resource compiler nearly readyMalcolm McLean
|  |    ||| `* Re: Baby X resource compiler nearly readyRichard Damon
|  |    |||  `- Re: Baby X resource compiler nearly readyTim Rentsch
|  |    ||`* Re: Baby X resource compiler nearly readyBen Bacarisse
|  |    || `* Re: Baby X resource compiler nearly readyDavid Brown
|  |    ||  +- Re: Baby X resource compiler nearly readyScott Lurndal
|  |    ||  `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |    ||   `- Re: Baby X resource compiler nearly readyScott Lurndal
|  |    |`- Re: Baby X resource compiler nearly readyTim Rentsch
|  |    +- Re: Baby X resource compiler nearly readyBen Bacarisse
|  |    `* Re: Baby X resource compiler nearly readyKeith Thompson
|  |     `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |      `* Re: Baby X resource compiler nearly readyjak
|  |       `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |        `* Re: Baby X resource compiler nearly readyjak
|  |         `* Re: Baby X resource compiler nearly readyMalcolm McLean
|  |          `- Re: Baby X resource compiler nearly readyMalcolm McLean
|  `* Re: Baby X resource compiler nearly readyBart
|   `- Re: Baby X resource compiler nearly readyBen Bacarisse
+* Re: Baby X resource compiler nearly readyScott Lurndal
|`* Re: Baby X resource compiler nearly readyKenny McCormack
| `* Re: Baby X resource compiler nearly readyScott Lurndal
|  `- Blah, blah, blah (Was: Baby X resource compiler nearly ready)Kenny McCormack
`- Re: Baby X resource compiler nearly readyBen Bacarisse

Pages:123
Re: Baby X resource compiler nearly ready

<87y1ilp0f3.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Baby X resource compiler nearly ready
Date: Tue, 08 Aug 2023 16:41:20 -0700
Organization: None to speak of
Lines: 42
Message-ID: <87y1ilp0f3.fsf@nosuchdomain.example.com>
References: <1c2d0b65-3e37-4534-966f-d039a655773cn@googlegroups.com>
<da68fd88-8d75-4601-bd7d-71d4109bf416n@googlegroups.com>
<LntMHk8YCfUSQ6SmB@bongo-ra.co>
<2f89490d-af9a-4cc8-ab08-80365edd6b52n@googlegroups.com>
<uao8iq$37ai9$1@news.xmission.com>
<9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com>
<uatkqt$3egu8$1@dont-email.me>
<87350tqf5f.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="913a52d54f1fb8cef77698b79d9b2607";
logging-data="3774181"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e7U6Zpjo8a0U5eff5eYJs"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Cs52XmbD+mCtva4+NI9w4GxuC2M=
sha1:x8s2ZeOBy5cQTQZs71iJk2AUl/c=
 by: Keith Thompson - Tue, 8 Aug 2023 23:41 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> David Brown <david.brown@hesbynett.no> writes:
>> On 06/08/2023 16:07, Malcolm McLean wrote:
>>> The problem is that the preprocessor doesn't understand typedefs. And no-one
>>> thought to make stdint.h's include guard part of its public specification.
>>> So there's no way of knowing whether the types have been defined or not.
>>>
>>
>> There is an extremely simple answer to all this:
>>
>> #include <stdint.h>
>>
>> There. Done. All your <stdint.h> types are defined and ready to use.
>
> Which is basically what Malcolm did to fix the problem. Here's the
> relevant change he made (commit 51f9819 in
> https://github.com/MalcolmMcLean/babyxrc):
>
> #if !NEED_MINILIBC
> + #include <stdint.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> + #define __int8_t_defined
> #endif
>
> Defining __int8_t_defined causes the code that conditionally defines
> int8_t et al to skip those definitions.
>
> Apparently src/libc.h was copied from some other project. I can't tell
> where it came from.
>
> Malcolm, can you tell us where that code originated?

My guess is that the author of that code assumed that <stdint.h> defines
the macro __int8_t_defined. Obviously it's not required to do so, but
perhaps the assumption was valid on the systems the author had tried.

--
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: Baby X resource compiler nearly ready

<bf89e3bf-f1e5-4b7c-b26e-0477611d1d11n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:472a:b0:762:55da:9784 with SMTP id bs42-20020a05620a472a00b0076255da9784mr28849qkb.5.1691546862072;
Tue, 08 Aug 2023 19:07:42 -0700 (PDT)
X-Received: by 2002:a05:6808:1789:b0:3a7:78a6:17b8 with SMTP id
bg9-20020a056808178900b003a778a617b8mr847492oib.2.1691546861753; Tue, 08 Aug
2023 19:07:41 -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: Tue, 8 Aug 2023 19:07:41 -0700 (PDT)
In-Reply-To: <87350tqf5f.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:e56b:26d4:2c8f:8f29;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:e56b:26d4:2c8f:8f29
References: <1c2d0b65-3e37-4534-966f-d039a655773cn@googlegroups.com>
<da68fd88-8d75-4601-bd7d-71d4109bf416n@googlegroups.com> <LntMHk8YCfUSQ6SmB@bongo-ra.co>
<2f89490d-af9a-4cc8-ab08-80365edd6b52n@googlegroups.com> <uao8iq$37ai9$1@news.xmission.com>
<9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com> <uatkqt$3egu8$1@dont-email.me>
<87350tqf5f.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bf89e3bf-f1e5-4b7c-b26e-0477611d1d11n@googlegroups.com>
Subject: Re: Baby X resource compiler nearly ready
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Wed, 09 Aug 2023 02:07:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3292
 by: Malcolm McLean - Wed, 9 Aug 2023 02:07 UTC

On Wednesday, 9 August 2023 at 00:38:03 UTC+1, Keith Thompson wrote:
> David Brown <david...@hesbynett.no> writes:
> > On 06/08/2023 16:07, Malcolm McLean wrote:
> >> The problem is that the preprocessor doesn't understand typedefs. And no-one
> >> thought to make stdint.h's include guard part of its public specification.
> >> So there's no way of knowing whether the types have been defined or not.
> >>
> >
> > There is an extremely simple answer to all this:
> >
> > #include <stdint.h>
> >
> > There. Done. All your <stdint.h> types are defined and ready to use.
> Which is basically what Malcolm did to fix the problem. Here's the
> relevant change he made (commit 51f9819 in
> https://github.com/MalcolmMcLean/babyxrc):
>
> #if !NEED_MINILIBC
> + #include <stdint.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> + #define __int8_t_defined
> #endif
>
> Defining __int8_t_defined causes the code that conditionally defines
> int8_t et al to skip those definitions.
>
> Apparently src/libc.h was copied from some other project. I can't tell
> where it came from.
>
> Malcolm, can you tell us where that code originated?
>
The MP3 decoder was written by Fabrice Bellard (of tcc fame) and incuded
in ffmpeg. Then it was taken out of ffmpeg by Martin J Fielder and "stripped down",
to turn it into what was essentially a single file decoder. However there were some
effiiciency hacks which were placed in libc.h. If you turn these off, effectively
libc.h just includes a few standard headers, and then defines the <stdint.h>
types.
The irony is that whoever chose to define the <stdint.h> types like that was
trying their best to make the code more portable, but in fact by so doing
they broke it.

Re: Baby X resource compiler nearly ready

<dVCAM.87316$ftCb.36397@fx34.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx34.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Baby X resource compiler nearly ready
Content-Language: en-US
Newsgroups: comp.lang.c
References: <1c2d0b65-3e37-4534-966f-d039a655773cn@googlegroups.com>
<da68fd88-8d75-4601-bd7d-71d4109bf416n@googlegroups.com>
<LntMHk8YCfUSQ6SmB@bongo-ra.co>
<2f89490d-af9a-4cc8-ab08-80365edd6b52n@googlegroups.com>
<uao8iq$37ai9$1@news.xmission.com>
<9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com>
From: Rich...@Damon-Family.org (Richard Damon)
In-Reply-To: <9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 38
Message-ID: <dVCAM.87316$ftCb.36397@fx34.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 8 Aug 2023 22:32:41 -0400
X-Received-Bytes: 3125
 by: Richard Damon - Wed, 9 Aug 2023 02:32 UTC

On 8/6/23 10:07 AM, Malcolm McLean wrote:
> On Sunday, 6 August 2023 at 14:52:40 UTC+1, Kenny McCormack wrote:
>> In article <2f89490d-af9a-4cc8...@googlegroups.com>,
>> Malcolm McLean <malcolm.ar...@gmail.com> wrote:
>> ...
>>> It's hard to write an MP3 decoder and, if someone has already made a
>>> working version available for free which fits in a single file, it's not a
>>> good use of my time. But these relatively trivial problems break whole
>>> programs. Some Linux users who download the Baby X resource compiler will
>>> be able to fix the compile errors quite quickly. But may will say "Oh, it
>>> doesn't compile, obviously it doesn't work on Linux".
>>>
>>> The whole point of portable programming is that it should work on an unknown
>>> target platform. But that's hard to achieve.
>> I have to admit that I haven't dug deeply enough into it to know (or care),
>> but it seems like if you can say "It should be easy enough for the user to
>> be able to fix the compile errors quite quickly", then it should be easy
>> enough for you, the developer, to fix it so that they don't have to. Am I
>> wrong?
>>
>> You should not have to re-write the whole MP3 decoder in order to
>> accomplish this (so that's kind of a red herring).
>>
> I hacked it. It's possible to write an MP3 decoder without using any fixed-width
> type (though you can forgive uint64_t). But to go through the code taking out
> all the fixed width dependencies would be quite an undertaking and likely to
> create errors. So I just included stdint.h and set the define. But it's not ideal.
>
> The problem is that the preprocessor doesn't understand typedefs. And no-one
> thought to make stdint.h's include guard part of its public specification.
> So there's no way of knowing whether the types have been defined or not.
>

Except that for every type in stdint.h properly defined DOES have a
macros defined for it, the XXX_MAX macro.

Of course, some rogue header could define the type but not the macro,
but it can be argued that such a header is broken.

Re: Baby X resource compiler nearly ready

<86wmy4afi9.fsf@linuxsc.com>

  copy mid

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

  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: Baby X resource compiler nearly ready
Date: Tue, 08 Aug 2023 23:36:46 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <86wmy4afi9.fsf@linuxsc.com>
References: <1c2d0b65-3e37-4534-966f-d039a655773cn@googlegroups.com> <da68fd88-8d75-4601-bd7d-71d4109bf416n@googlegroups.com> <LntMHk8YCfUSQ6SmB@bongo-ra.co> <2f89490d-af9a-4cc8-ab08-80365edd6b52n@googlegroups.com> <uao8iq$37ai9$1@news.xmission.com> <9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com> <dVCAM.87316$ftCb.36397@fx34.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="c08257b67d6868119c472d7304d82d93";
logging-data="4002325"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RLqaoI63OGgeFBz2tV6kG/sudCjlPSDY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:lBYjsCioA/5oU3eoLLO0fJCGRJA=
sha1:dnQkDy80ZL3/HS5TcAFSgLSxOuE=
 by: Tim Rentsch - Wed, 9 Aug 2023 06:36 UTC

Richard Damon <Richard@Damon-Family.org> writes:

> On 8/6/23 10:07 AM, Malcolm McLean wrote:

[..working on code that uses [u]intN_t from <stdint.h>..]

>> I hacked it. It's possible to write an MP3 decoder without using
>> any fixed-width type (though you can forgive uint64_t). But to go
>> through the code taking out all the fixed width dependencies would
>> be quite an undertaking and likely to create errors. So I just
>> included stdint.h and set the define. But it's not ideal.
>>
>> The problem is that the preprocessor doesn't understand typedefs.
>> And no-one thought to make stdint.h's include guard part of its
>> public specification. So there's no way of knowing whether the
>> types have been defined or not.
>
> Except that for every type in stdint.h properly defined DOES have a
> macros defined for it, the XXX_MAX macro.
>
> Of course, some rogue header could define the type but not the
> macro, but it can be argued that such a header is broken.

Changing the code so it avoids the [u]intN_t types altogether
(and no longer needs <stdint.h>) is not hard. I did it in
about 30 minutes.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor