Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: 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> <2f89490d-af9a-4cc8-ab08-80365edd6b52n@googlegroups.com> <9c9dee88-2625-4589-a85f-c2b03666a96an@googlegroups.com> 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= Xref: csiph.com comp.lang.c:171910 Richard Damon writes: > On 8/6/23 10:07 AM, Malcolm McLean wrote: [..working on code that uses [u]intN_t from ..] >> 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 ) is not hard. I did it in about 30 minutes.