Sujet : Re: C23 thoughts and opinions
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 30. May 2024, 09:09:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240530110905.0000022e@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Thu, 30 May 2024 02:32:03 -0000 (UTC)
Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Wed, 29 May 2024 13:58:20 +0200, Bonita Montero wrote:
I've got a small commandline-tool that makes a const'd char
-array from any binary file.
It seems to me it would be more efficient to use objcopy to turn that
binary file directly into an object file with symbols accessible from
C code defining its beginning and ending points. Then just link it
into the executable.
Of course, it is more efficient.
But:
- it covers fewer use cases.
- it exposes array's name and size as global symbols which is not
always desirable
- it feels too much like a magic. It would feel less like a magic if
done by compiler rather than by extra tool. Even better if done by
compiler in standardized manner.
But yes, in real life, in embedded software project, that's what I'd do.