Liste des Groupes | Revenir à cl c |
On 2025-03-20, bart <bc@freeuk.com> wrote:I just tried to compile it; it needs an extra q8defs.h file (600 more lines), but it fails: "CPU not recognised" (it might have a point if this was from the 1990s!).On 20/03/2025 23:18, Keith Thompson wrote:That's not all that is needed; the material in Q8defs.h is requiredbart <bc@freeuk.com> writes:>On 20/03/2025 19:10, Keith Thompson wrote:[...]bart <bc@freeuk.com> writes:>>stdint.h et al are just ungainly bolt-ons, not fully supported by theNo, they're fully supported by the language. They've been in the ISO
language.
standard since 1999.
I don't think so. They are add-ons that could have been created in
user-code even prior to C99 (user-defined typedefs for 64 bits would
'need long long').
Sure, they could; see Doug Gwyn's q8, for example.
Isn't that what I said? However I've just looked at this 700-line header:
>
https://www.lysator.liu.se/c/q8/stdint.h
>
Sorry, but there's something wrong if you have to write all that to get
a handful of fixed-width types.
to make the material in the above file work.
It's not just the types, but all the standard-required identifiers.
I feel that this Q8 could probably have been organized a little
differently to make it more compact.
The Q8defs.h header already has conditionals for platforms.
Then Q8's inttypes.h still has to switch on some more abstract
conditions in the preprocessor to select the types.
This two layer business could just be one, more or less.
Q8defs.h could just define, for instance, q8_uintptr_t,
for each platform, and then inttypes just has to expose it under the
standard name:
typedef q8_uintptr_t uintptr_t;
(And if this is for a multitude ofWhat? That would pretty much defeat the whole point of this Q8 library.
targets, then there should be a dedicated header per target).
What would would select which file to use where?
You drop those files into your C90, and then you have a facsimile
of C99 compatibility, on all the platforms supported by Q8.
GCC's stdint.h is 200 lines. Mine is 75 lines. It these types were partQ8 tries to add the C99 stuff for something like 7 implementations
or implementation familes. GCC is one implementation, but with
many targets.
Doing stuff the C way requires LOTs of lines of code. Look at all those MIN/MAX macros, the PRINT/SCAN macros; there's hundreds of them!of the core language, it would be zero lines.This kind of argumentation is really not of good quality.
A feature requires lines of code. If those lines are not in some
satellite file like a C header, then they are elsewhere, like in the
compiler source code.
It's not "zero lines" because you hid it in the compiler.The compile has to cope with fundamental types anyway; there's a limit to what headers can do: they have to build on something.
Les messages affichés proviennent d'usenet.