Deutsch English Français Italiano |
<vvhap5$1hp80$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Richard Heathfield <rjh@cpax.org.uk> Newsgroups: comp.theory Subject: Re: Formal systems that cannot possibly be incomplete except for unknowns and unknowable Date: Thu, 8 May 2025 05:09:07 +0100 Organization: Fix this later Lines: 70 Message-ID: <vvhap5$1hp80$1@dont-email.me> References: <vv97ft$3fg66$1@dont-email.me> <b47c9e70d415c1e5e469aaab846f0bd05e4bcc51@i2pn2.org> <vvall0$o6v5$1@dont-email.me> <vvc33h$25atc$1@dont-email.me> <vvcgja$1voc$1@news.muc.de> <vvd6pf$34l9k$1@dont-email.me> <vvdads$13pc$1@news.muc.de> <vvdcld$3arjo$1@dont-email.me> <vvg6r9$15e69$1@dont-email.me> <vvg7uu$158tp$4@dont-email.me> <vvg8tk$15e69$4@dont-email.me> <vvgai8$158tp$6@dont-email.me> <vvgcme$15e69$9@dont-email.me> <vvgjdo$18i6e$2@dont-email.me> <vvgkao$18q46$1@dont-email.me> <vvgkd7$15i5e$23@dont-email.me> <vvgkum$18q46$3@dont-email.me> <vvgleo$15i5e$24@dont-email.me> <vvgov4$1a47o$2@dont-email.me> <vvgp8b$15i5e$25@dont-email.me> <vvgpk6$1a47o$4@dont-email.me> <vvgpo7$15i5e$26@dont-email.me> <vvgq6o$1acph$1@dont-email.me> <vvgqgl$15i5e$27@dont-email.me> <vvgr22$1ag3a$2@dont-email.me> <vvgt36$1auqp$2@dont-email.me> <vvgtbe$1b0li$1@dont-email.me> <vvguot$1auqp$3@dont-email.me> <vvh0t2$1b939$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 08 May 2025 06:09:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="fc99c878bc8892c2ff7fc287d1c7246a"; logging-data="1631488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bAD5Ob++Uw9hqWnvexMNyIEE1KwFnxOcoo93dzZjWJQ==" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:FwQHryOrbnXejtTdngx4bM+DRfA= In-Reply-To: <vvh0t2$1b939$1@dont-email.me> Content-Language: en-GB Bytes: 3901 On 08/05/2025 02:20, olcott wrote: <snip> > Does there exist an HHH such that DDD emulated by > HHH according to the rules of the C programming language Let's take a look. The file is 1373 lines long, but don't worry, because I plan to stop at HHH's first departure from the rules of the C programming language (or at least the first departure I spot). Turn in your songbook if you will to: void CopyMachineCode(u8* source, u8** destination) { u32 size; for (size = 0; source[size] != 0xcc; size++) ; *destination = (u8*) Allocate(size); for (u32 N = 0; N < size; N++) { Output("source[N]: ", source[N]); *destination[N] = source[N]; } ((u32*)*destination)[-1] = size; Output("CopyMachineCode destination[-1]: ", ((u32*)*destination)[-1]); Output("CopyMachineCode destination[-2]: ", ((u32*)*destination)[-2]); }; I'll ignore the syntax error (a null statement at file scope is a rookie error). Instead, let's jump straight to this line: *destination = (u8*) Allocate(size); On line 79 of my copy of the code, we find: u32* Allocate(u32 size) { return 0; } In C, 0 is a null pointer constant, so Allocate returns a null pointer constant... which is fine as long as you don't try to deref it. So now *destination is NULL. We go on: for (u32 N = 0; N < size; N++) { Output("source[N]: ", source[N]); *destination[N] = source[N]; } *destination[N] is our first big problem (we're ignoring syntax errors, remember). destination is a null pointer, so destination[N] derefs a null pointer. That's a fail. 0/10, D-, go away and write it again. And you /dare/ to impugn other people's C knowledge! Crack a book, for pity's sake. -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within