Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Sat, 01 Jun 2024 17:26:41 -0700 Organization: A noiseless patient Spider Lines: 35 Message-ID: <867cf8p4u6.fsf@linuxsc.com> References: <20240530170836.00005fa0@yahoo.com> <20240530180345.00003d9f@yahoo.com> <20240531161937.000063af@yahoo.com> <20240531162811.00006719@yahoo.com> <20240531164835.00007128@yahoo.com> <20240531173437.00003bee@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 02 Jun 2024 02:26:42 +0200 (CEST) Injection-Info: dont-email.me; posting-host="487e0958afb8d1cfa0659a77e612b1fd"; logging-data="3188784"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uQpB0z9VpqIWUn57HCesSjYK4eVMI3cs=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:FohHJE50I3Pc06ufkSFApqcHorw= sha1:Zk83lqxhOyBvpui3aJvBELKkekg= Bytes: 2689 jak writes: > bart ha scritto: > >> On 01/06/2024 02:37, jak wrote: >> >>> bart ha scritto: >>> >>>> I can see that the first two can be subtracted to give the sizes >>>> of the data, which is 70 or 0x46. 0x46 is the last byte of the >>>> address of _size, so what's happening there? What's with the crap >>>> in bits 16-47? >>>> >>>> I can extract the size using: >>>> >>>> printf("%d\n", (unsigned short)&_binary_hello_c_size); >>>> >>>> But something is not right. I've also asked what is the point of >>>> the -size symbol if you can just do -end - -start, but nobody has >>>> explained. >>> >>> typedef unsigned char uchar; >>> extern uchar _binary_hello_c_size[]; >>> long hello_c_size = _binary_hello_c_size - (uchar *)0; >> >> What result for the size did you get when you ran this? >> >> It seems people are just guessing what might be the right code and >> posting random fragments! > > I wrote it that way precisely because I believed it was the clearest > way. [...] What is most clear is that the expression used has undefined behavior.