Received: (at 75451) by debbugs.gnu.org; 21 Jan 2025 00:24:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 19:24:26 2025 Received: from localhost ([127.0.0.1]:52372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ta249-0003eW-Vg for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 19:24:26 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:32888) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1ta247-0003eD-2E for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 19:24:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id B29453C026D7F; Mon, 20 Jan 2025 12:25:20 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id kGZf-CxMBhXz; Mon, 20 Jan 2025 12:25:20 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 6DE4C3C03E9E1; Mon, 20 Jan 2025 12:25:20 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 6DE4C3C03E9E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1737404720; bh=gIj4dbf6sMTPJO5p+wBhyWazZPy2ZrlhdRTyEBpwa60=; h=Message-ID:Date:MIME-Version:To:From; b=YSQk3kaoMgwvxQR+sl7IQdtO2XCY/dzKFD1aPTCVxVa937gt/jClgHAF67Kt7IOMC 8IqUWfSGABk5iQ8de9h6BIWPXYiMyewizqE9HKjIaGY3SWh1Rqagm4AUYV5CEM7Shg dsCkDGgIYdnhl9NooG+iRNPc1fXi7PQZ5mLRmrzPfMVMf4ou0b2K/B9EqCRqxm8M/O YDwUPrBLqXuvMi1900auEAyk77DbKPuin0ZtsQJfCeDPAlk3mS53cXH6BEdjBX6DF1 PxTZ/AeolAr6gTUPnh9X33Nt4iBfLwNaFKg4dML4qaMN6OhTyahpXW9NnsDgX0ZyiT SK/wGC0U/wTAg== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 66dxfKtVS-bZ; Mon, 20 Jan 2025 12:25:20 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 4B7803C026D7F; Mon, 20 Jan 2025 12:25:20 -0800 (PST) Message-ID: <d62b72d8-7acc-4190-bc89-08711815ae0f@HIDDEN> Date: Mon, 20 Jan 2025 12:25:20 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Stefan Kangas <stefankangas@HIDDEN>, Pip Cet <pipcet@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> <CADwFkm=+0O+7jTL+Q-uxn5Z=+tZeHsarUTdyc0EEkf+HgUHv4g@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <CADwFkm=+0O+7jTL+Q-uxn5Z=+tZeHsarUTdyc0EEkf+HgUHv4g@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-01-20 09:54, Stefan Kangas wrote: > If I'm reading Paul correctly, he's saying that a static check is > more reliable. Yes, because a static check doesn't rely on test cases that exercise the dynamic check appropriately. Typically we have no such test cases. I see Pip's point. However, I don't think it's worth coming up with a new macro if GCC doesn't issue the proper diagnostics. Having an assertion that isn't checked is not gonna maintain well. It sounds like it'd better to get GCC fixed first, to do what we want. Ideally GCC would come up with something where our existing macros suffice or even can be reduced in number (though the macro implementations might need changing).
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 23:43:19 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 18:43:19 2025 Received: from localhost ([127.0.0.1]:52221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ta1QI-0001ch-Ty for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:43:19 -0500 Received: from mail-106110.protonmail.ch ([79.135.106.110]:47459) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1ta1QG-0001cK-0a for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:43:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737405177; x=1737664377; bh=+WxVcNp8qT0QObY0iD74zWbNmeERXUtn9jL3lKl8xpM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=h1TuRypWqBULDZH0GdnoGtnknJrlJGebu9NIu/41Ak0oA054fRL/D4pwt2/EgBAnV pzVPiu48nFnkRlckjRrIzqoDahYwMmCIusnoZ3pnwl2DXJemNjJOdjR9TK8Z/xfobk 6aofEJo3XCF1SaYblCAeUzBkLxOPvCJtarr/OEsmeZ0ErMYsOKnHvRSbJrkX9SO12W UzHyzIwk7hQy2b3jKFmIrX7p5FPFNtgUviG3YjSShdqgteG9qRePCsjc1asa2J31+s lFcuSzATYncC2/izfOzFAp0P2rAgMOLUlHtoN5XKOHotucvPL7klnJTvFqj3ke0Fxu T4oHkZ8lql4Tw== Date: Mon, 20 Jan 2025 20:32:53 +0000 To: Stefan Kangas <stefankangas@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87a5bl2plc.fsf@HIDDEN> In-Reply-To: <CADwFkm=+0O+7jTL+Q-uxn5Z=+tZeHsarUTdyc0EEkf+HgUHv4g@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> <CADwFkm=+0O+7jTL+Q-uxn5Z=+tZeHsarUTdyc0EEkf+HgUHv4g@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 785d7cf47653b5669fe198b91aa035ddba3ebc1e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: "Stefan Kangas" writes: > Pip Cet writes: > >> Using "break" instead of "return" is impossible: >> >> * "default: eassume (0);" means you lose compiler warnings if the enum is >> expanded. -Wswitch-enum generates the compi [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [79.135.106.110 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [79.135.106.110 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [79.135.106.110 listed in sa-trusted.bondedsender.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pipcet[at]protonmail.com) 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: 75451 Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.1 (/) "Stefan Kangas" <stefankangas@HIDDEN> writes: > Pip Cet <pipcet@HIDDEN> writes: > >> Using "break" instead of "return" is impossible: >> >> * "default: eassume (0);" means you lose compiler warnings if the enum = is >> expanded. -Wswitch-enum generates the compiler warnings, but they're >> lost in a sea of false positives because sometimes we cannot switch over >> an enum exhaustively. >> >> * "default: emacs_abort ();" will generate code to handle the "impossibl= e" >> case >> >> * Omitting the default statement will make GCC treat the fall-through ca= se >> as reachable >> >> This is because this code: >> >> #include <stdio.h> >> >> enum three { A, B, C }; >> >> int main (void) >> { >> volatile enum three four =3D C + 1; >> volatile const char *bad =3D 0; >> switch (four) { >> case A: >> case B: >> case C: >> printf ("%s\n", "good"); >> break; >> default: >> printf ("%s\n", bad); >> } >> return 0; >> } >> >> is treated by GCC as valid code and the "bad" printf cannot be >> determined to be unreachable. > > I have no reason to doubt that you are correct, but what are the > consequences for us, in concrete terms, that make you say that "using > 'break' instead of 'return' is impossible"? Given that most programs I'm sorry, I meant that it's impossible to replace the version that works with one that doesn't while maintaining the right set of compiler warnings. Of course the code will work fine no matter which option you use: sometimes we'll get warnings about missed cases, sometimes we won't; sometimes, an unnecessary extra case will be generated, sometimes it won't. > run just fine despite the shortcomings and/or bugs you have identified > in GCC, I think that saying using the switch statement in the normal way > is "impossible" might be overstating the case. It certainly is overstating the case, and I'm sorry I wasn't clearer. What is hard (not impossible) is to get the right warnings from GCC: if you want your switch statement to be exhaustive, you shouldn't include a default case; if you don't have a default case, the fall-through path will be reachable, as far as GCC is concerned, and prompt additional warnings; if you fix that by adding "default: eassume(0);", you lose the exhaustiveness warning; if you fix that by adding -Wswitch=3Denum, you get too many false positives for enums that aren't even controlled by Emacs; if you fix that by adding #pragma statements around all the places that depend on external enums which might change, you have set a lingering trap for future developers, as #pragmas tend to move away from their intended region and disable more warnings than you want them to. (See bug#71744 / commit 1282714da55cd4bbc1c7f2e49edeb43503427e5e for a bug made harder to discover by a #pragma that no longer made sense.) After all this, you still don't get any warnings if you use enum values in the labels but the switch parameter has an int type: if a new glyph type is added to enum glyph_type, x_draw_glyph_string won't warn about it. (Yes, dispextern.h should use ENUM_BF, will come up with a patch, but GCC should *also* have warned about the code in x_draw_glyph_string before that). > My apologies if I'm missing the point that you're making here. You're not. I was getting overexcited and forgot to carefully check whether pragmas can be made to work. They're ugly, but right now it looks like the answer is "yes, if you use ENUM_BF; if you don't, tough luck". Thanks for calling me out on this. > BTW, has this been reported to the GCC developers? I've only just become aware of how bad it is. I'll report it in due time, after searching for previous issues. The switch ((int) x) { case ENUM_A: ... } thing was easy enough to fix, and I have a vague feeling that someone out there is mixing different enums in the same switch statement and warning about that will help them. A related issue I don't fully understand yet is why extern int flag; int main (void) { int ret; // uninitialized switch (flag) { case 0: ret =3D 1; } return ret; } doesn't appear to produce a warning with -Wuninitialized or -Wmaybe-uninitialized. (-Wnull-dereference is even worse: at -O1, gcc doesn't complain about extern int *flag; int main (void) { int ret; // uninitialized switch (*flag) { case 0: return 1; } return ret + *(int *)0; } in any way that I can find, and returns 1 unconditionally, ignoring the flag entirely. I'll report that one first, I guess). >> Let's introduce macros for the different cases, and use the same macro >> in the same case, until GCC offers a fix. > > I'm with Gerd here, and not too excited about the prospect of yet > another macro. I'd rather do without the additional warning, and just > have it crash at runtime instead, like we do now. rsvg doesn't crash, it'll just fail to display the image, IIUC. > But are we sure that installing my patch would make things worse? It would make things better! I disagreed with the "think carefully about each enum switch and choose between options, then hardcode that one option in the code so no one can ever see the bugs you decided not to warn about" approach, particularly if it amounts to leaving detectable bugs for others to find. However we decide to do this, there are only two semantically different valid enum switches: an exhaustive one, and one that cannot be exhaustive because we don't control the enum, or because we do but it has too many members for us to list. If we decide that the former (which should be the much more common case) doesn't require a default: label, your patch is fine; we'll just have to make that case work with GCC so it warns about non-exhaustive switches, and doesn't generate the new spurious warnings I'm seeing here: pdumper.c:4561:6: warning: =E2=80=98mem_prot=E2=80=99 may be used uninitial= ized [-Wmaybe-uninitialized] 4561 | if (mem_prot !=3D PROT_NONE) | ^ > If I'm reading Paul correctly, he's saying that a static check is > more reliable. I'll have to reread. With my GCC, I don't believe that's true: where the old code will abort, the new code will produce spurious warnings in some cases, and fall through and leave things uninitialized without warning about them in others, IIUC. Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 23:31:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 18:31:22 2025 Received: from localhost ([127.0.0.1]:52101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ta1En-0000zY-NF for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:31:22 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:58474) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1ta1Ej-0000zB-RY for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 18:31:18 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa68b513abcso922177766b.0 for <75451 <at> debbugs.gnu.org>; Mon, 20 Jan 2025 15:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737415870; x=1738020670; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=NqhMcsjmt7zpSDiS2UAFUh4Ogu3FYky1j11/0YCkNDc=; b=dW5qTz6bFAi9ezdeIoy32R5NrpELIbBj4TON/VfsUmCe0u8yKQO9Nt2woFe4hQofpE dfhvTehFnLayo8QXVr7Svr+Dv2ZNN6TMbBd9O/DynVQqZQZlfZYxQKv/skrtU9cwS9gc PaFIkCgFSXA1DzYKe/q0YfJuYsbF16VGs1tlXhA+u2I6OWMLWlXxb0QrqFUeZEA2qD8z CocDwL+V4noAWmmSxxKp0sjHrRlxnMfC2jwJnl3H5suoT76G5yCJPQa83h/c22am6bog UrX7WFTXyR0LjARf7WX8CxwtFRGl88WHu/hsIv4hWWl7Hjb8bNx6FReN4TyN6dgdL3IN Z5uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737415870; x=1738020670; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NqhMcsjmt7zpSDiS2UAFUh4Ogu3FYky1j11/0YCkNDc=; b=TY0vGloYvFIAzjjQycOR6IqfOxbX/I2fTL+sBZnYO/FnSoMPBw8mzJyzMd7tRtmZd8 9ta8QwYtKfoPyFhVoRMF6mAuTktOYDD2GwJQzOYGRxoaD5nGEsYnizKMaJWf9GpjcF5B D9qs7sfQ8sM0OYDrC/vjFfHc3riNut8n27/bHHOwA7oxBEZpYrkAs20UvLkrQ+BIUBcE 9ZktiiREkns9/q5mRJsUPQTs5WtzTwdt6Y5+QPu94mngNpJPb5abwxDCJd/3F/xhJn+B 07Y603ws8iOok7tZ7RshrTr0pVGtAj2xSJ7L4v+xcCiSVIiBWj2FbS5fuQci7DcREgjw ADqQ== X-Forwarded-Encrypted: i=1; AJvYcCWjwUXEbC4DV4u0K/x9dMBpgS7cJAwAUc9fjDJw09R4iNXeStuWgsyjBx8cYu6SlTm7rqeIIw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyA9n+21s9R71Y9BtAavD7BZ9ONVBV5vsxNYTZNTHjaj/yLLQEf 12ye9+W2Gx9FFxvuH01fUY2MXS3ztf15wy++YrJaNH4QKOJX3np9BMjSsPgxfPga02aFAwod9ts ugm8nUShZrVdcLl2gaWrJzMhJdzbeS40Y6ds= X-Gm-Gg: ASbGnctXwBnyj7JBt0KVOyFnDCjmNHIT7XA/KeEeyJ60B2sS8bMwE0NQ6aSeIug/NaB u/xs/bXzBg5bqlkLG07qkVa8H/+wWPHoJ9biyhSX1xg6RFJISnrA= X-Google-Smtp-Source: AGHT+IFh3/bVR1dtAbhhLv2/Xi34EuwSelMORvIzBNYg4QuJX3iT6/Z76PNIehMmVa2GHAjisaeTbcAbQx5Nq2dnJF8= X-Received: by 2002:a17:906:7314:b0:aa6:6a52:970 with SMTP id a640c23a62f3a-ab38b0ba253mr1441342966b.1.1737404592642; Mon, 20 Jan 2025 12:23:12 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 20 Jan 2025 12:23:12 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87ed0xykig.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <d5513bd5-3185-4fa9-a2f1-2b59078d63fb@HIDDEN> <87ed0xykig.fsf@HIDDEN> MIME-Version: 1.0 Date: Mon, 20 Jan 2025 12:23:12 -0800 X-Gm-Features: AbW1kvZZlASeOFMne-6UOAGXTDFoyJ_RjPtbVPNwGwi9Q-P8kfH0PT8somNMbNM Message-ID: <CADwFkmkuNaptgRzWGDU510DX6wxPGJ8D96g_NUrVdxhQWWsZ4w@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN>, Paul Eggert <eggert@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Pip Cet writes: > svg_css_length_to_pixels doesn't handle the RSVG_UNIT_CH case. I don't > know at which version rsvg started to offer this unit; it's not It seems to have been added in 2.58: Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62c listed in] [list.dnswl.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: 75451 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.1 (/) Pip Cet <pipcet@HIDDEN> writes: > svg_css_length_to_pixels doesn't handle the RSVG_UNIT_CH case. I don't > know at which version rsvg started to offer this unit; it's not It seems to have been added in 2.58: https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/enum.Unit.html I will create a new bug report to track this. > indicated in the header file. The default case: > > default: > /* We should never reach this. */ > value = 0; > > contains an incorrect comment (the header file warns that the enum is > incomplete and will be expanded), and incorrect code (0 is not a good > default value, and we should warn or return an error). We would have detected this bug sooner with the below patch, no? diff --git a/src/image.c b/src/image.c index b8405d81111..7fda2684460 100644 --- a/src/image.c +++ b/src/image.c @@ -12008,9 +12008,6 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size) what size we make the image. */ value = 0; break; - default: - /* We should never reach this. */ - value = 0; } return value;
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 17:54:40 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 12:54:39 2025 Received: from localhost ([127.0.0.1]:52239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZvyx-0007kT-Er for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 12:54:39 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:56411) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tZvyu-0007kB-63 for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 12:54:38 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5d3f65844deso7851882a12.0 for <75451 <at> debbugs.gnu.org>; Mon, 20 Jan 2025 09:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737395670; x=1738000470; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=LYjINtshCoMDBr4GZABiiVH8xrzrxfHQRrZ5g+dP8Co=; b=SPgge/VB3wab4wrBfynl3qKxPoo6vde0e/GNwxfXtjMFepnJGsknaYcwzGof0Sqc/X oJkTRxBxH03rNLLNMXUQR4CDmfoYuWwfe/T99qNGUWXT1gw4OJTpG4M34e42eDVG53HO xwAUV59yAZ7GWoN4fL+rK9UBTJCXnQ12OOu4RH+s/fYwFiWOGpI8NTpN/IzIUUKxI1ul KqJV6eb3/XFVw47iNLkf1lHQkCi7tUBk1s2abG9pbZM0KtSi7wg//9s11vLnumUeje4h YadZoPrItL7Alh1kkW2rLP/Xzw0PFhZ78wAh/iH/dbe8DGuTlxXIVI+mZOS8nbXwt13V YkAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737395670; x=1738000470; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LYjINtshCoMDBr4GZABiiVH8xrzrxfHQRrZ5g+dP8Co=; b=fVdVLBik1Pef+3Am64OQT3PexSXWNGAyEmlugju5bYrxlIH4jiRSMGvg5+6zQzIiKq gAjXqdU3I4Cs98Ng1AqCU6eykEPUGQfiZ6rJFu+S/L7CGBMAalLyuBsIyS+rcYosJxzT VXPcqs5jQfPOMm0hLuiuNHHiYmiS/PiZ7114HZFKEwaE3u7IKhkCNmpOFDVWVnu6Y+On 54fyu6ZHgojB5hz5yUuGnPMt8dtELAnojO2PgdETno9/x3hlK3QIINLkRr9TiGD49h2b w+R3Mp0NAx8szEg1P/sGxWnC1Q1VwNDQ6BgCzybmFV6jLlyrkwU1Drk7CYnhlg1R7Dkl JJRg== X-Forwarded-Encrypted: i=1; AJvYcCVAQTjZqk2+AZxU8zzyXbkN8hBKci3KC1Mo50FAf/3TXAuoWtmQ3wRk8rSF99IPUry2gWnWNQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzJ+uJbvLSc0eLNjb9T3qe0rGWCt/8NmL7yOrBxe0B/TjGa4/gi Pr/2f9p4KZgD9uT7ASI3VJUBsipPFN9I1A9+IleVVVQm7VCRjQhV9yNb1mY8IUEbImeqqUvUbCs KDwYrIMmlDIriRQjcyocokmaK12o= X-Gm-Gg: ASbGncvuL4le076AyIRGge3w4+E9G133h8S2mMhDSaQN8fKo5Jlgka1RP9qJ8gyJm1p DaZ6nf7ayEETpcQbPcUzOd459gN0jgojmiIue8SQD4NDo3RcD8Gf5zw== X-Google-Smtp-Source: AGHT+IFMGhYYyHW+SBFchLIeYrIksb+Lh5EDZgGbSsNgmHCKpgHL/0IZPd9TgMNIOWkNls865JCUJwJMOoAdF8LJCbk= X-Received: by 2002:a05:6402:35d3:b0:5d0:feec:e15d with SMTP id 4fb4d7f45d1cf-5db7d2f9af6mr11267788a12.8.1737395669721; Mon, 20 Jan 2025 09:54:29 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 20 Jan 2025 09:54:28 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87jzaqx72v.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> MIME-Version: 1.0 Date: Mon, 20 Jan 2025 09:54:28 -0800 X-Gm-Features: AbW1kva2HnskgH1zn5szbjqfLLcNB8K1S9-YE8X69CvfaIjNtKzQv-TCHmmkG30 Message-ID: <CADwFkm=+0O+7jTL+Q-uxn5Z=+tZeHsarUTdyc0EEkf+HgUHv4g@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: > Using "break" instead of "return" is impossible: > > * "default: eassume (0);" means you lose compiler warnings if the enum is > expanded. -Wswitch-enum generates the compiler warnings, but they're > lost in a sea of false positives because sometimes we cannot switch over > an enum exhaustively. > > * "default: emacs_abort ();" will generate code to handle the "impossible" > case > > * Omitting the default statement will make GCC treat the fall-through case > as reachable > > This is because this code: > > #include <stdio.h> > > enum three { A, B, C }; > > int main (void) > { > volatile enum three four = C + 1; > volatile const char *bad = 0; > switch (four) { > case A: > case B: > case C: > printf ("%s\n", "good"); > break; > default: > printf ("%s\n", bad); > } > return 0; > } > > is treated by GCC as valid code and the "bad" printf cannot be > determined to be unreachable. I have no reason to doubt that you are correct, but what are the consequences for us, in concrete terms, that make you say that "using 'break' instead of 'return' is impossible"? Given that most programs run just fine despite the shortcomings and/or bugs you have identified in GCC, I think that saying using the switch statement in the normal way is "impossible" might be overstating the case. My apologies if I'm missing the point that you're making here. BTW, has this been reported to the GCC developers? > Let's introduce macros for the different cases, and use the same macro > in the same case, until GCC offers a fix. I'm with Gerd here, and not too excited about the prospect of yet another macro. I'd rather do without the additional warning, and just have it crash at runtime instead, like we do now. But are we sure that installing my patch would make things worse? If I'm reading Paul correctly, he's saying that a static check is more reliable.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 09:17:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 04:17:41 2025 Received: from localhost ([127.0.0.1]:48944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZnue-0005Dn-PS for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 04:17:41 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:49484) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tZnuc-0005DW-3K for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 04:17:38 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso28581175e9.3 for <75451 <at> debbugs.gnu.org>; Mon, 20 Jan 2025 01:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737364651; x=1737969451; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nf8y2CdmL2vUF16MOdMtTJEpZXwW0XHnLfGK0zt7Xf8=; b=Pdyrn72dQVUiPHQ6j0rMIWs7OMjErtcD05oguMcjy0crXqdh+UVO6bH1D6hRxCriqP IAvlNs5iEMNh7oeiuUwFDHAlT/vr4yEZj1QH3FPzo5O0tbT2ulZdR1/34BGaolYihVzb xuJIbrSu3OF3eIh3PixbVVZKTdAPpE95q08dEghpx9LpL0GdFbjVmnrZLwEDy0MV2GBX jdc+UGimxrXQMZ2FJV+HsylpKhuRMa0WGkDU1Zh/jZ/IvmrCFxXUgZg98RkIq1I3zTm9 V2DK0jtTsKLzb4OGtrsurmxG009wgkSncTza0PISxeMSLIBQ0gD+/AaMcamcgzIlpRwx JlOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737364651; x=1737969451; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nf8y2CdmL2vUF16MOdMtTJEpZXwW0XHnLfGK0zt7Xf8=; b=en4xQpMUOxKkinaKor/NHw0VspxcsivF4k1Lx3XnwNMajoaE2Gd9WvV37tNq0GmrRx XAJ1E/f8AisTiDY9MnFdfdtHmjvWGRlG3Ope3gwl312zDJa2i35okrAbtnyBkmZify/V +jm2YE21T2RzQo0v7NIndIMBUCnqrtDrqX1Q0CguknXxclPlgwhAhb9tA+AuBQhYD1nQ jMq+67OP1v0aqP99vwW+cK6o9XHR131RGFAWIm1paejRSr7lntLwnfz8OO0Hi3lWObBD gOHfg27UWYEnCtxXcqKlmNcA6g6fj5OqjsH19n3cT7blwrDzMB36sZlwF1EThf1sEVoY oqfQ== X-Forwarded-Encrypted: i=1; AJvYcCWnaFxji4WnAMy2T7CdqSzxu9IKzxqaFYYLRFHLv9Hm8SeFeisW9MsArM63Ubi96AssnRzLiA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzG2idiPc9I9Arli6OCdha9YJM7IvtxiPv60QI/GVrdJNLUqZcn CEcC8CDQCm0OYNcr8b7Xcwu0shlJUkUIYn546LhrFYAmx4T7GGUsYpePVQ== X-Gm-Gg: ASbGncv9DfuWHwII6v4AUHbH5Jz/pXttK8kpPg81+wlydYbMcqhmoc3NoqL3W4fuxS5 KiM4kywjbbdNbQaWb5/nT2gkfB9FuSMkgrdVtrH1Ene4ua+az4TOOYd5t29dC8AhokgpaUDGFTh 8OZoS//afB5T3yJKhnygXnHrMecU1jMqJ8atPGp0ygPKQ1PmKorAHKYZSYkYlI5pYRwMklg8Ys0 ZLi5kw2c87ChJgbre8uQVtH3agA/zhzW7R5zAjLhmoQyXxRVxPm6eDaa20evHvQBLtdhDSEAKDz qjMEFyTXPaxaJaQlis9/Hb00yCKSPWLB9Fz4yAejk2s6ZxMKqn1hiQvDI1lieivWe/yWa8T7Juz HcK0= X-Google-Smtp-Source: AGHT+IGQ1Z2dmOrexFf8s0DYKj7oMayCS2waWLaJvlegHy38PRTMSKVUiBeX1QKMd5JWKQCmaDhkmQ== X-Received: by 2002:a05:600c:4e08:b0:434:a4a6:51f8 with SMTP id 5b1f17b1804b1-438912d4a3bmr123029735e9.0.1737364651319; Mon, 20 Jan 2025 01:17:31 -0800 (PST) Received: from pro2 (p200300e0b70637004598b6f24df6b6a8.dip0.t-ipconnect.de. [2003:e0:b706:3700:4598:b6f2:4df6:b6a8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c0efccf7sm128945125e9.0.2025.01.20.01.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 01:17:30 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <87zfjlx3ll.fsf@HIDDEN> (Pip Cet's message of "Mon, 20 Jan 2025 09:00:12 +0000") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> <m2jzapc4ae.fsf@HIDDEN> <87zfjlx3ll.fsf@HIDDEN> Date: Mon, 20 Jan 2025 10:17:29 +0100 Message-ID: <m2bjw1c09i.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: > Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: > >> Pip Cet <pipcet@HIDDEN> writes: >> >>>> Thanks, that's helpful. Based on the above, I came up with the attach= ed >>>> patch for pdumper.c. >>> >>> Let's introduce macros for the different cases, and use the same macro >>> in the same case, until GCC offers a fix. >> >> Pretty please not more macros. > > Why not? We need to distinguish "default case reached for some enum > values" and "default case reached only for non-enum values, warn if it's > reached for enum values"### Emacs already has too many macros for may taste. I'd rather loose a warning or optimization than complicate things further. Just my 2 cents.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 09:00:28 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 04:00:27 2025 Received: from localhost ([127.0.0.1]:48920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZndz-0004Rm-Fx for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 04:00:27 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:63977) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tZndx-0004RV-5R for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 04:00:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737363618; x=1737622818; bh=zwka2KHJfFD57w7Yly+0uZYcBeEOlAWTf9za0TV3l1g=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=DECyv4cKCuCkPAIfhmBgj3t2d3/sQijeq3sNIFWxbud9bz3qUXc424MaPtA8IaXyL 7W3sfXXTqIWsTFKXQoxU+kwuvqLYKyZo0w8aCfc4apkAT9TYTaaiPGLufwvF+RI92R v4rDKtQIFGKrx7iqer92tWd/9TkUeLn2Tt1kajECzZ+A749jQDehEzxf1mdvkqoxWU uZFj08n1WaOchiRgBGda7asB/A522Ux5TbYNIAC1lv7HARymE2tS90HiNpMKD3zrOk psWbE/rgieGnONNPHH0SE8wcwrakvkxRDsZ90GipGvhQKPaO2jp34Phe/jKcAdoQLD bxMXemqAC2xDg== Date: Mon, 20 Jan 2025 09:00:12 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87zfjlx3ll.fsf@HIDDEN> In-Reply-To: <m2jzapc4ae.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> <m2jzapc4ae.fsf@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 996afafe76d025aefb7f57e63eadb75276386d69 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: > Pip Cet <pipcet@HIDDEN> writes: > >>> Thanks, that's helpful. Based on the above, I came up with the attache= d >>> patch for pdumper.c. >> >> Let's introduce macros for the different cases, and use the same macro >> in the same case, until GCC offers a fix. > > Pretty please not more macros. Why not? We need to distinguish "default case reached for some enum values" and "default case reached only for non-enum values, warn if it's reached for enum values". I'm still not sure what the best way of expressing those two different semantics of default labels is, and I don't think we should put the "switch" or "default" in a macro, but it would involve some macros because it relies on compiler features not always available (and #pragma is horrible and shouldn't be used). Think something like enum ABC abc =3D whatever; switch (abc) { case A: case B: handle(); break; default: prove_or_warn (!in_enum (abc, enum ABC)); } in_enum would verify that a value is one of the enumerated values rather than an invalid one. prove_or_warn would produce a compiler warning if its argument isn't __builtin_constant_p and true. (The usual way to make GCC do that is to call an undefined extern symbol if the argument is false; if it's provably true, GCC won't try to link against the symbol). The problem is that it wouldn't work with "-O0", which makes __builtin_constant_p useless. But that's a minor change we need to make anyway: right now, "make" builds Emacs just once and we look at the compiler warnings from that run. With the static analyzer and things like that, we need a separate make target for extra compiler warnings. (We should run this by default, of course). (That would also solve the texinfo/@xref problem: texinfo apparently cannot generate the warning, so let's make that new target check for invalid @xrefs using some simple Elisp). Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 08:09:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 03:09:47 2025 Received: from localhost ([127.0.0.1]:48868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZmqx-0001zU-7i for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 03:09:47 -0500 Received: from mail-10628.protonmail.ch ([79.135.106.28]:13037) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tZmqu-0001zE-Kk for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 03:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737360576; x=1737619776; bh=ceLIgiG614zoIc41wpdHBgoQ6+01xp7f6C/KBI1gDec=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=JPJMYm3ot8VaVABM9LEuGFjJNPCzU0T2Q6d4Z6ffaOZq7zkWNXZkjMgr9WdwaDfdd UkPszKpPeeA+AI06l/PBktkUhHR7Q2sd9ZUTviGaryEQzkTATZvA2HgWGxNoW+5fT0 NwUlTzbU98oBSEYYl7aZgvseEoo/LOHfrH2f4D++C0Cia1sWgecAw9uGpGLZ2reWi/ CuV4BeNcoVziHqxQkE5bPCSnpEoJeg34mKYXKMymqoTiE9r4CmynEMdt0R01SeBK8i ioqq5wTd1cQ/VvxdIE6HozxBwpY5W1MXlcFdBlYrT0odKVCMDdf2lNXBAq2ClIGAxK 2w+TFjNn/PlVA== Date: Mon, 20 Jan 2025 08:09:32 +0000 To: Paul Eggert <eggert@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87ed0xykig.fsf@HIDDEN> In-Reply-To: <d5513bd5-3185-4fa9-a2f1-2b59078d63fb@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <d5513bd5-3185-4fa9-a2f1-2b59078d63fb@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 2336020b7f7ae87862d91f9d97da10b8d97a288c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Paul Eggert" <eggert@HIDDEN> writes: > On 2025-01-19 18:01, Stefan Kangas wrote: >> In my attached patch, >> there is one removal of 'default: eassume(false)'; how can I know if >> it's worth keeping or not? > > There are a few reasons to have such a line. First, to pacify a GCC > false alarm. Second, to make the code clearer to a human reader. Third > (less likely), to generate more efficient code. If no reason applies I > would omit such lines. I think this approach is bad. We should determine whether the switch is meant to be exhaustive across an enum, and use a macro in this case, or whether it isn't, and use another macro. After that, we're done, and we'll have to wait for GCC to be fixed. We cannot and should not look at each individual case and decide arbitrarily what to do. GCC does not currently provide a way to define these macros: either you pass -Wswitch-enum, and all switches over enum types produce warnings (losing the ones you actually care about in a sea of false positives you cannot fix), or you don't, and then we lose valuable warnings and introduce bugs such as this one: svg_css_length_to_pixels doesn't handle the RSVG_UNIT_CH case. I don't know at which version rsvg started to offer this unit; it's not indicated in the header file. The default case: default: /* We should never reach this. */ value =3D 0; contains an incorrect comment (the header file warns that the enum is incomplete and will be expanded), and incorrect code (0 is not a good default value, and we should warn or return an error). (I'm not a fan of statement attributes, but they're probably the best solution here. They were introduced for fallthrough, so I don't see why they couldn't distinguish the two very different semantics of "default" labels. See https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html) >> int type =3D XFIXNUM (dump_pop (&lreloc)); >> reloc.emacs_offset =3D dump_off_from_lisp (dump_pop (&lreloc)); >> dump_check_emacs_off (reloc.emacs_offset); >> - switch (type) >> + switch ((enum emacs_reloc_type) type) > > When it's easy, let's avoid casts like that as they're too powerful: you I agree this cast should be avoided. GCC incorrectly decided to determine whether a switch is an enum switch or not based only on the type of the switch value, not on the type of the case labels. This is fixable (see what I posted before) and should be fixed. The correct code is the old version. That GCC fails to produce a warning is a GCC deficiency which needs to be fixed. > can cast pointers by mistake. Here it's easy to omit the cast, and > declare the local variable 'type' to be of type 'enum emacs_reloc_type' > rather than of type 'int'. (I assume you know for other reasons that the > value is in range for the enum - otherwise the cast wouldn't be valid > either.) In other words, just change the first line to: > > enum emacs_reloc_type type =3D XFIXNUM (dump_pop (&lreloc)); In this case, I agree this change should be made, but only because we already have a variable. If that weren't true, introducing one to work around the GCC deficiency here is doing the compiler's job, and we should avoid doing that if it's easier to make the compiler do it. switch (XFIXNUM (lispval)) { case ABC_A: return a; case ABC_B: return b; default: __attribute__ ((warn_if_covered_by_enum_case)); eassume (0); } should produce a warning (if the ABC enum contains A, B, and C). We don't have that attribute yet, so let's introduce a macro and wait for it to be implemented. Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 07:50:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 02:50:43 2025 Received: from localhost ([127.0.0.1]:48854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZmYV-00019H-FS for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:50:43 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:57490) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tZmYT-000192-Qc for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:50:42 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4362f61757fso42390015e9.2 for <75451 <at> debbugs.gnu.org>; Sun, 19 Jan 2025 23:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737359435; x=1737964235; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=HcUTUIhyW9iFVFvVz+WWmPtk5eoIeYfBbZZw5kXfwA4=; b=QcCohRqILPLBaq1M3+wEbayY4KlVnosBGA09KC+WA09DYmPiHO5dT5SO3I1ekST4hy WWCczqLB+z1i1csJcMSTrXPNc5kN8ko6bCnRILblIVD6FKlIAXJILZiFUxDmivw6kxsJ TX0hWbYM08o5u2ekn5nq4OE6ndpLlj5fE6/SXXdZwLHTG4Dy9noGgZHSwfd+0s8LvUYB e4UggZwFIQDTQsTYY3yJO8uh572+iTBeaov2AJaxrZofZTu2mUwYBPp7Srny10N9NRCo zgea9xFhctDA9aABUQpppy4OJFAYQYi40rFrPxo5ZzXt6Swjj+S8NI6NE/fZwXizeB22 2dzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737359435; x=1737964235; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HcUTUIhyW9iFVFvVz+WWmPtk5eoIeYfBbZZw5kXfwA4=; b=EpSTsOaz4lwwL/ubong64Z0FkZABw/8ATjBROe0tY2Cwh3iClAKwojajW1A8HVHrsk eeHZZ376z0d5l55QXBjUgyKS7nQVIaqJCA6UsX/YRdKO++q8Wg0a4X2WUCyjCN1PxlR+ BMJqOme9Onhr0eLTz78P7puAoGCg80mr4xcY3+k1LOw1vVF4pydNneYapP3BuQOaEDEN njM+uyuuUtj75J9a6d2B+ijKFYRveWOkFTwtVjk3UG8oixzOsCixjzHfHudB1wUq/skD GRTaW3oVToJ/Pnvbo5Qcex2StmQf62la+M/S7VSqhWjfdFjkoG8F5I68H4eZVnPE1jpw uSGw== X-Forwarded-Encrypted: i=1; AJvYcCXXWCLlDN0WXOZkyk/aCNQTWXJMYhQtexISVwoOOUrHRtmUp0gPILTCx/aIev79wehjFMb2iA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzSo1daCQOaUKgVJilwSieK6Ii94IRUcjn93QcOeSodRm47rByL F+VwDG+COQEO1dp78Ip4oZJNjgbaHVvvt9qzp4zN54dttEzh+PXwKoalEg== X-Gm-Gg: ASbGnct53rtETQrXs1VDmBXdqBAPDMEP9Ec1OhKywOoQcGe/zgXLZYaXYW0y4Wj2ecl XpuN8wzm3NbnzthMeb53IJmtFKBvPbN9I9ttUbl8pJinb4vqNj3l7yajssFbBE1mQwloATWVBRf FKDQD5YeDX/SaiaARFAb5PPBx53sxchbYQlFjAaOQR5t2duYa+3MlgePKpbdw9FIamyXB+VvDRA uQ28NoephMn63+9vTIxcu/pOBahE2baWVVt1b1IyPvetJB5GsCg2SP2I0FzF+etaBfyh6sUl3nw OhQXkdRloroxbdLDS/D8SWZDhinvHMbcG/3hY708SPLwHrTTTGI8QmfvPhcK2t78MHKGl37IqAF EHbk= X-Google-Smtp-Source: AGHT+IERT/5CCDbfA90t/g/LlWHRos83Cx6fcvpuyT0ZrYGhnRha3e5z9XtFQHktL2jCEQIviAqCRw== X-Received: by 2002:a05:600c:4713:b0:436:9227:915 with SMTP id 5b1f17b1804b1-438913caa3cmr93809035e9.9.1737359435210; Sun, 19 Jan 2025 23:50:35 -0800 (PST) Received: from pro2 (p200300e0b70637004598b6f24df6b6a8.dip0.t-ipconnect.de. [2003:e0:b706:3700:4598:b6f2:4df6:b6a8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438904086cfsm130216265e9.4.2025.01.19.23.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jan 2025 23:50:34 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <87jzaqx72v.fsf@HIDDEN> (Pip Cet's message of "Mon, 20 Jan 2025 07:45:02 +0000") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> <87jzaqx72v.fsf@HIDDEN> Date: Mon, 20 Jan 2025 08:50:33 +0100 Message-ID: <m2jzapc4ae.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: >> Thanks, that's helpful. Based on the above, I came up with the attached >> patch for pdumper.c. > > Let's introduce macros for the different cases, and use the same macro > in the same case, until GCC offers a fix. Pretty please not more macros.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 07:45:17 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 02:45:17 2025 Received: from localhost ([127.0.0.1]:48841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZmTE-0000sd-Iq for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:45:17 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:21813) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tZmTC-0000nr-8x for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:45:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737359107; x=1737618307; bh=EpIc7tJUjQOgiYH24gONROtAr9xwYkTDG1dzRBOE6hA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=qu+03ODivJdwfqxaj/6V+lszgjVlpAul2PbVMvxowqXnn7Ywr6WE8EUTEmnkF1HAK iehkyOM48CWTX05k6KDguu24DR6Si/t7WLusi8v3UKosRsK+2v+EEgVTNwyy393xwn iGCBXlq9ZzmlVZR1CvHLpYOZ1h2mHnak3BnCWarCrUneueI/XnW9afLVP7N7aXAqWq YNcJL7Xz+V/eYQdNull9xUkjlyeaNQGwOeXsAuY5pZVBYPAnwpD30SX96Raa0zGDCy +jqg/TMHmLOICEb0pWGjZgTeIRyoQYZXcohDp1C2YsK2HXau5YbI/f5RGHkMOwrbBz YcFDox1qB9MHg== Date: Mon, 20 Jan 2025 07:45:02 +0000 To: Stefan Kangas <stefankangas@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87jzaqx72v.fsf@HIDDEN> In-Reply-To: <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 7429de3e5acc19152aa8111ef8f473e05939f795 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Stefan Kangas" <stefankangas@HIDDEN> writes: > Paul Eggert <eggert@HIDDEN> writes: > >> Yes, inserting 'default: emacs_abort ();' switches from static to >> dynamic checking, which is less reliable. Although 'default: emacs_abort >> ();' is sometimes the best one can do, it's better to avoid it when >> possible. >> >> I use 'default: eassume (false);' more often than 'default: emacs_abort >> ();', though for a completely different purpose: to tell GCC something >> that it's not smart enough to figure out on its own, so that GCC can do >> better static checking elsewhere. My understanding is the only correct exhaustive enum switch right now looks like this: int switch_statement(enum ABC x) { switch { case A: case B: return 0; case C: return 1; } eassume (0); } Using "break" instead of "return" is impossible: * "default: eassume (0);" means you lose compiler warnings if the enum is expanded. -Wswitch-enum generates the compiler warnings, but they're lost in a sea of false positives because sometimes we cannot switch over an enum exhaustively. * "default: emacs_abort ();" will generate code to handle the "impossible" case * Omitting the default statement will make GCC treat the fall-through case as reachable This is because this code: #include <stdio.h> enum three { A, B, C }; int main (void) { volatile enum three four =3D C + 1; volatile const char *bad =3D 0; switch (four) { case A: case B: case C: printf ("%s\n", "good"); break; default: printf ("%s\n", bad); } return 0; } is treated by GCC as valid code and the "bad" printf cannot be determined to be unreachable. (BTW: The correct behavior of this program, on GNU systems, is to print "(null)". GCC miscompiles it so it segfaults instead. This is a long-standing and severe compiler bug, and I doubt it'll ever be fixed.) -Wmaybe-uninitialized also does not behave as documented in code like the above: if I access an uninitialized variable in just one of the branches, there's no warning. > Thanks, that's helpful. Based on the above, I came up with the attached > patch for pdumper.c. Let's introduce macros for the different cases, and use the same macro in the same case, until GCC offers a fix. > But could you explain your last paragraph above? In my attached patch, > there is one removal of 'default: eassume(false)'; how can I know if > it's worth keeping or not? This is an impossible decision. None of the options GCC provides are good. The best we can do is to distinguish them by using different macros and waiting for GCC to be fixed. Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 05:03:49 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 20 00:03:49 2025 Received: from localhost ([127.0.0.1]:48654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZjwy-0001Ja-Eq for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 00:03:48 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:41616) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1tZjwq-0001Iz-Gj for 75451 <at> debbugs.gnu.org; Mon, 20 Jan 2025 00:03:45 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id B46553C03E9EA; Sun, 19 Jan 2025 21:03:34 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id J9b7MkncI94z; Sun, 19 Jan 2025 21:03:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 519763C123864; Sun, 19 Jan 2025 21:03:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 519763C123864 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1737349414; bh=V3w51Wj/0Rot5sNHRkXu5+fi35N/Sr7mwG3tSp5sBQY=; h=Message-ID:Date:MIME-Version:To:From; b=LhxgJqjEqTnc7VqmQ9BGs9JxXKIYh0gmSiUaDPmomeSm71bLvMz17MxgxE6AxembV LwJYdyRc8Cd7vwibJ75VklpA1iJDWi+AoFmhBy4LbjyiRj0jhBsVvLbc5//1s22YMg 6VcJqQHyhFtgSk8ChmPElFx7pPDy0ABwB4NQOh6+nZLEHxN/qBzhznkitBSEIdfUnB 8tpywRSAItXLGMVdDuMv8Ajw9qJK9rH3fXb2LpIH6QqsZIBR78glpnT4NQM57BiQJ6 AlwSahITPIMkPhmo/QHhNXXno06AtMdnDvunffhe7wt5qJKI8RoAFYkC2kqYU/WcRC VfD/rDKaroRsA== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 8D5jJyA6NJhL; Sun, 19 Jan 2025 21:03:34 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 30C6F3C03E9EA; Sun, 19 Jan 2025 21:03:34 -0800 (PST) Message-ID: <d5513bd5-3185-4fa9-a2f1-2b59078d63fb@HIDDEN> Date: Sun, 19 Jan 2025 21:03:33 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Stefan Kangas <stefankangas@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Pip Cet <pipcet@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-01-19 18:01, Stefan Kangas wrote: > In my attached patch, > there is one removal of 'default: eassume(false)'; how can I know if > it's worth keeping or not? There are a few reasons to have such a line. First, to pacify a GCC false alarm. Second, to make the code clearer to a human reader. Third (less likely), to generate more efficient code. If no reason applies I would omit such lines. > int type = XFIXNUM (dump_pop (&lreloc)); > reloc.emacs_offset = dump_off_from_lisp (dump_pop (&lreloc)); > dump_check_emacs_off (reloc.emacs_offset); > - switch (type) > + switch ((enum emacs_reloc_type) type) When it's easy, let's avoid casts like that as they're too powerful: you can cast pointers by mistake. Here it's easy to omit the cast, and declare the local variable 'type' to be of type 'enum emacs_reloc_type' rather than of type 'int'. (I assume you know for other reasons that the value is in range for the enum - otherwise the cast wouldn't be valid either.) In other words, just change the first line to: enum emacs_reloc_type type = XFIXNUM (dump_pop (&lreloc)); This way, the last line can remain unchanged and there is no need for a cast.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 03:32:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 19 22:32:27 2025 Received: from localhost ([127.0.0.1]:48548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZiWY-00032W-Kj for submit <at> debbugs.gnu.org; Sun, 19 Jan 2025 22:32:26 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:48330) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tZiWW-00031c-Dp for 75451 <at> debbugs.gnu.org; Sun, 19 Jan 2025 22:32:24 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso27030005e9.0 for <75451 <at> debbugs.gnu.org>; Sun, 19 Jan 2025 19:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737343938; x=1737948738; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=XUVUbNaZzNiLruW7DNhviI1Pl8FLcUTEUBE5CO3MhjY=; b=h+74flf5EQ6LECD14G0A82rMLLrocSi8shQcV7AYTRxJpTvJmMS3KfdTWt5EUIN7xf 7QFKBSgXWAaDzN6zMkTk+oNFoEtdYmwmsoXiHJAqex2kF0gaYq7q66mK/oY5E2Gwuajv J+XDQTGFYNsUbPETCLhkWq7C+ig3SVbZDlptq5RYHGwxELuzNS+5I34yTN1yXvf+3Eq9 ffYnokK3f8J9HNs2TVBNLM4BOih/QJWiZ6njjnh4zigO86T/1RgCskgTPWzIEpj6geJf okiDtS6eSBCwNCvlciua8ZPwJpPtBfqL4OKlPqF4SsvWBnBRWtdCjhDoNMDjqV6Z+sml ZUng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737343938; x=1737948738; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XUVUbNaZzNiLruW7DNhviI1Pl8FLcUTEUBE5CO3MhjY=; b=iusW6nGX5iG6b9GOqIcXdzp+Z+RHOWcmwCj1xPmPrcMuHjZFzpOo3+PeWHoJTvTIJq NM2VPxdmpuO3irNS8/MlLnIhH3xw3UD5h1JEkr+d+gGoNKJ2k89Yn3vEdW+HCz7dO51F rGl1Fg4Q8Oq4zdUFldDKCrj3sZ2Hmb/Jd/71S9w+6FsCpy20t+yKcRqbVkk0qZqThkK1 WacyMSNbM0sNFOjVjhf4Z5qslGHQFcbMnn5ax634LbTsRbSFMTZ3/1MDWB/kAm/dM+Yp EbAgV//pAuVeOU+ZPgAp+1AcEmOuhB38NC93x9zHjAJXnZrsEMoLFvdg6jXwCAJjWuAH TIUQ== X-Forwarded-Encrypted: i=1; AJvYcCVcImGAHpKNGzgGnbsT6deJiUSQ27MPnkiRsjTpalAnhnqd2P9QzpNi5vx68EDd05m1uPA3qA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxsbcuuXPLGiPNDXpIWPefF3KWbWYsyCZQOYfIGf2xRGlboQNHS 7JQ8RflgbtQtYOXBTdZhus6UWnacvtkAMeZjOBxUwh0c2BGVN+B/3M8UJg== X-Gm-Gg: ASbGncvi449OqwLb1Fl+JBxV+SamAkePNnsuH0IS3tVBfX4Wicis/lwXMilqM4+29Xm uuPLihNNxnaOdtU6gq16W6ERoeLTMnBjEoMY6xGXpE4WDMd0gycoOKfVG7D0bE7TGl5iBKWIW6M o3dOQ/Fz8R5uM7/ZedwjxGPjDcM5nn5GVfgshk4TMrfuf3392sTGuYaYPtZ6eUff0eb1UWWvJ/C GMKx7rgQKj00hZRtExmmmAJ7A+rjPpBsMeUsmxT1wGOaKmcoj7GFXDeVG7u1Qdre5WIOly4tylz IKwiNf+vuw6UNSGpM5Qx0mKVBkcmbls6jlwDSIqDkGQAq7h3GrXdU6e3BoghpLd9cpQUhtTBn/X oJTo= X-Google-Smtp-Source: AGHT+IHH7dVw1KiQOg0eQ7HYj9o+HrVbiKtoZa5s2VnR2DlV5o7P+93Ry+bj0B9fVjBMgnV+oHGxoQ== X-Received: by 2002:a05:600c:4f43:b0:434:a1d3:a326 with SMTP id 5b1f17b1804b1-438913bf07dmr99342515e9.6.1737343937630; Sun, 19 Jan 2025 19:32:17 -0800 (PST) Received: from pro2 (p200300e0b70637004598b6f24df6b6a8.dip0.t-ipconnect.de. [2003:e0:b706:3700:4598:b6f2:4df6:b6a8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389041fe29sm121130345e9.22.2025.01.19.19.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jan 2025 19:32:16 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> (Stefan Kangas's message of "Sun, 19 Jan 2025 20:01:31 -0600") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> Date: Mon, 20 Jan 2025 04:32:14 +0100 Message-ID: <m2o702b1oh.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Pip Cet <pipcet@HIDDEN>, Paul Eggert <eggert@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Kangas <stefankangas@HIDDEN> writes: > Thanks, that's helpful. Based on the above, I came up with the attached > patch for pdumper.c. LGTM
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 20 Jan 2025 02:01:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 19 21:01:41 2025 Received: from localhost ([127.0.0.1]:48384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tZh6j-0007Df-75 for submit <at> debbugs.gnu.org; Sun, 19 Jan 2025 21:01:41 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:46203) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tZh6g-0007DQ-KD for 75451 <at> debbugs.gnu.org; Sun, 19 Jan 2025 21:01:39 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5d96944401dso7048228a12.0 for <75451 <at> debbugs.gnu.org>; Sun, 19 Jan 2025 18:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737338492; x=1737943292; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Lz6Z9i4pdCXMHP6J6eQyImvP27Yst796KD+4aU9HCyE=; b=aHquQjKfvQKMxKzG4dzPJ+BNPsat6jhNqX371gnalK/3hlFIIbHkCs6hL5LIfYVVng vYsigQTSUVWMDqa44RiR7UbvGDHSbiOdtMQhYk/JZcLi8qeJsUpIAxIujaBg6qpS9PrN pZfYF1GkvvcVpL8yLyZGJcGgfTkO9lBl8OvAR5bthhVW/1X07cJqrdHFhB5uAnn8qph5 /9VidAcL80KwSZmUtwL6BssQ+KHQ32XpZI6EhGuscVuwVwbM/jrM1Jf2o1gW/F4fbzvH AOoFxJMRB41tBwMiwpEnSfx3KZ3HygnscdgCFDv6rQjhqrGaWz6kbmSafoll1W+Zsbio QF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737338492; x=1737943292; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lz6Z9i4pdCXMHP6J6eQyImvP27Yst796KD+4aU9HCyE=; b=BztB0SrcvU+S7tEf1N4f/S7/KztGQqzV5fF3K1yA/9+KeP4k5q3MMLb2JhSuiX+25L d/yLCuAqhqTM3p+zjGA6DMTjeYw+vUwRJmcirDj+GEClDizfVFiXQyeNF/ax6uc4hsgB qZU/ZN5rZesnj8eSZ2fQSdyvhA5XuWnPOeLh6PnA63OtXEYkQtvcAclxcGkQqqIzeSlE YbPP13jHQRTy+bslR9K8uzqbqdkaCYhAxZRZUrszABokAy3KEiGkKe0XC8sgB+6WaHM5 MaOeMjMNaTdG1YINn7RTuh0aUdP1ypQp3zLQnJCZPV9wYehXMmOG2tgyLLn1N9UIxjWH /NHQ== X-Forwarded-Encrypted: i=1; AJvYcCVHGId91KFp27u4p1AQCzZ0IlXc7cip3cl4ABYj7pRC2qtM1LPcFysT9grqDbRbIuO4HYRO8w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxsUQaPgY47OhCYs9b0y57vdYBUYGTPKzuZ75bsKmZoZ29lZY0T o74C9LnKG7FOAyH1nHCgMJUd4jMdVQeawvwV6t0N2wwf5uABYBXh8DT2yVPkd7HwyKkej3tv00v P1KeRY9FrkUwcQtb+fUfPagFBR/U= X-Gm-Gg: ASbGncvbRp4FpGfmB3u3OlolVJhd3wrZ7kKph2PTpgeXBMrCWoS8AJH3/7zd0uZ8qu6 isqgeB0Q6cjVMdh/WjMC4d8RSgzD+9nqOVT4j15GFB+3N9XIRwwM2 X-Google-Smtp-Source: AGHT+IFs8CPVKt+KJOOEMVlVmK/qiZ3k2G3uLz5ZXCp9RpJBiCUpwWemdkxBjCGVyYQnFGMrMGgzNo03BvMbKpOItwY= X-Received: by 2002:a05:6402:254a:b0:5d3:d4cf:fea0 with SMTP id 4fb4d7f45d1cf-5db7db122c9mr9386638a12.21.1737338492036; Sun, 19 Jan 2025 18:01:32 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 19 Jan 2025 20:01:31 -0600 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> MIME-Version: 1.0 Date: Sun, 19 Jan 2025 20:01:31 -0600 X-Gm-Features: AbW1kva5J_IdalnsDrv0eAy8XuYckqnlhKMu-zYy7RaESsQQgp2kE-2KGYb9DOU Message-ID: <CADwFkmmL1aG4c9HbqN8k5ys-Czs9TG_1KAQJx2WRKXGHzyKexQ@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Paul Eggert <eggert@HIDDEN>, =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Content-Type: multipart/mixed; boundary="000000000000ac64d6062c19a396" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Pip Cet <pipcet@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --000000000000ac64d6062c19a396 Content-Type: text/plain; charset="UTF-8" Paul Eggert <eggert@HIDDEN> writes: > Yes, inserting 'default: emacs_abort ();' switches from static to > dynamic checking, which is less reliable. Although 'default: emacs_abort > ();' is sometimes the best one can do, it's better to avoid it when > possible. > > I use 'default: eassume (false);' more often than 'default: emacs_abort > ();', though for a completely different purpose: to tell GCC something > that it's not smart enough to figure out on its own, so that GCC can do > better static checking elsewhere. Thanks, that's helpful. Based on the above, I came up with the attached patch for pdumper.c. But could you explain your last paragraph above? In my attached patch, there is one removal of 'default: eassume(false)'; how can I know if it's worth keeping or not? --000000000000ac64d6062c19a396 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Prefer-static-switch-case-checks-in-pdumper.patch" Content-Disposition: attachment; filename="0001-Prefer-static-switch-case-checks-in-pdumper.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 7bb531baf50a1dbe_0.1 RnJvbSA3MzdhNWFkMjBhZGVlZTBhOTE5YWRlY2Y1N2YyYmE1MmQ4MWYwZDc4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBNb24sIDIwIEphbiAyMDI1IDAyOjQ3OjMwICswMTAwClN1YmplY3Q6IFtQQVRDSF0g UHJlZmVyIHN0YXRpYyBzd2l0Y2gtY2FzZSBjaGVja3MgaW4gcGR1bXBlcgoKKiBzcmMvcGR1bXBl ci5jIChkdW1wX2Z3ZCwgZHVtcF9zeW1ib2wsIGR1bXBfZHJhaW5fY29sZF9kYXRhKQooZGVjb2Rl X2VtYWNzX3JlbG9jLCBkdW1wX2RvX2ZpeHVwLCBkdW1wX2Fub255bW91c19hbGxvY2F0ZV93MzIp CihkdW1wX2Fub255bW91c19hbGxvY2F0ZV9wb3NpeCwgZHVtcF9tYXBfZmlsZV93MzIsIGR1bXBf bWFwX2ZpbGVfcG9zaXgpCihkdW1wX2RvX2VtYWNzX3JlbG9jYXRpb24pOiBSZW1vdmUgZGVmYXVs dCBjbGF1c2VzIHRvIHN3aXRjaCBmcm9tCmR5bmFtaWMgdG8gc3RhdGljIGNoZWNraW5nLgotLS0K IHNyYy9wZHVtcGVyLmMgfCAyMyArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5n ZWQsIDEgaW5zZXJ0aW9uKCspLCAyMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9zcmMvcGR1 bXBlci5jIGIvc3JjL3BkdW1wZXIuYwppbmRleCBlODNjN2JjZjlhMS4uODY1NzZhZjlkOGEgMTAw NjQ0Ci0tLSBhL3NyYy9wZHVtcGVyLmMKKysrIGIvc3JjL3BkdW1wZXIuYwpAQCAtMjM5MCw4ICsy MzkwLDYgQEAgZHVtcF9md2QgKHN0cnVjdCBkdW1wX2NvbnRleHQgKmN0eCwgbGlzcGZ3ZCBmd2Qp CiAgICAgY2FzZSBMaXNwX0Z3ZF9LYm9hcmRfT2JqOgogICAgICAgb2Zmc2V0ID0gZHVtcF9md2Rf a2JvYXJkX29iaiAoY3R4LCBwKTsKICAgICAgIGJyZWFrOwotICAgIGRlZmF1bHQ6Ci0gICAgICBl bWFjc19hYm9ydCAoKTsKICAgICB9CiAKICAgcmV0dXJuIG9mZnNldDsKQEAgLTI1MjMsOCArMjUy MSw2IEBAIGR1bXBfc3ltYm9sIChzdHJ1Y3QgZHVtcF9jb250ZXh0ICpjdHgsCiAgICAgY2FzZSBT WU1CT0xfRk9SV0FSREVEOgogICAgICAgZHVtcF9maWVsZF9maXh1cF9sYXRlciAoY3R4LCAmb3V0 LCBzeW1ib2wsICZzeW1ib2wtPnUucy52YWwuZndkKTsKICAgICAgIGJyZWFrOwotICAgIGRlZmF1 bHQ6Ci0gICAgICBlbWFjc19hYm9ydCAoKTsKICAgICB9CiAgIGR1bXBfZmllbGRfbHYgKGN0eCwg Jm91dCwgc3ltYm9sLCAmc3ltYm9sLT51LnMuZnVuY3Rpb24sIFdFSUdIVF9OT1JNQUwpOwogICBk dW1wX2ZpZWxkX2x2IChjdHgsICZvdXQsIHN5bWJvbCwgJnN5bWJvbC0+dS5zLnBsaXN0LCBXRUlH SFRfTk9STUFMKTsKQEAgLTM2MDEsOCArMzU5Nyw2IEBAIGR1bXBfZHJhaW5fY29sZF9kYXRhIChz dHJ1Y3QgZHVtcF9jb250ZXh0ICpjdHgpCiAJICBkdW1wX2NvbGRfbmF0aXZlX3N1YnIgKGN0eCwg ZGF0YSk7CiAJICBicmVhazsKICNlbmRpZgotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgIGVt YWNzX2Fib3J0ICgpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zODE1LDcgKzM4MDksNyBAQCBk ZWNvZGVfZW1hY3NfcmVsb2MgKHN0cnVjdCBkdW1wX2NvbnRleHQgKmN0eCwgTGlzcF9PYmplY3Qg bHJlbG9jKQogICBpbnQgdHlwZSA9IFhGSVhOVU0gKGR1bXBfcG9wICgmbHJlbG9jKSk7CiAgIHJl bG9jLmVtYWNzX29mZnNldCA9IGR1bXBfb2ZmX2Zyb21fbGlzcCAoZHVtcF9wb3AgKCZscmVsb2Mp KTsKICAgZHVtcF9jaGVja19lbWFjc19vZmYgKHJlbG9jLmVtYWNzX29mZnNldCk7Ci0gIHN3aXRj aCAodHlwZSkKKyAgc3dpdGNoICgoZW51bSBlbWFjc19yZWxvY190eXBlKSB0eXBlKQogICAgIHsK ICAgICBjYXNlIFJFTE9DX0VNQUNTX0NPUFlfRlJPTV9EVU1QOgogICAgICAgewpAQCAtMzg4Miw4 ICszODc2LDYgQEAgZGVjb2RlX2VtYWNzX3JlbG9jIChzdHJ1Y3QgZHVtcF9jb250ZXh0ICpjdHgs IExpc3BfT2JqZWN0IGxyZWxvYykKICAgICAgICAgICB9CiAgICAgICB9CiAgICAgICBicmVhazsK LSAgICBkZWZhdWx0OgotICAgICAgZWFzc3VtZSAoISJub3QgcmVhY2hlZCIpOwogICAgIH0KIAog ICAvKiBXZSBzaG91bGQgaGF2ZSBjb25zdW1lZCB0aGUgd2hvbGUgcmVsb2NhdGlvbiBkZXNjcmlw dG9yLiAgKi8KQEAgLTQwNjcsOCArNDA1OSw2IEBAIGR1bXBfZG9fZml4dXAgKHN0cnVjdCBkdW1w X2NvbnRleHQgKmN0eCwKICAgICAgICAgZG9fd3JpdGUgPSBmYWxzZTsKICAgICAgICAgYnJlYWs7 CiAgICAgICB9Ci0gICAgZGVmYXVsdDoKLSAgICAgIGVtYWNzX2Fib3J0ICgpOwogICAgIH0KICAg aWYgKGRvX3dyaXRlKQogICAgIGR1bXBfd3JpdGUgKGN0eCwgJmR1bXBfdmFsdWUsIHNpemVvZiAo ZHVtcF92YWx1ZSkpOwpAQCAtNDUyNyw4ICs0NTE3LDYgQEAgZHVtcF9hbm9ueW1vdXNfYWxsb2Nh dGVfdzMyICh2b2lkICpiYXNlLAogICAgICAgbWVtX3R5cGUgPSBNRU1fQ09NTUlUOwogICAgICAg bWVtX3Byb3QgPSBQQUdFX1JFQURXUklURTsKICAgICAgIGJyZWFrOwotICAgIGRlZmF1bHQ6Ci0g ICAgICBlbWFjc19hYm9ydCAoKTsKICAgICB9CiAKICAgcmV0ID0gVmlydHVhbEFsbG9jIChiYXNl LCBzaXplLCBtZW1fdHlwZSwgbWVtX3Byb3QpOwpAQCAtNDU2Nyw4ICs0NTU1LDYgQEAgZHVtcF9h bm9ueW1vdXNfYWxsb2NhdGVfcG9zaXggKHZvaWQgKmJhc2UsCiAgICAgY2FzZSBEVU1QX01FTU9S WV9BQ0NFU1NfUkVBRFdSSVRFOgogICAgICAgbWVtX3Byb3QgPSBQUk9UX1JFQUQgfCBQUk9UX1dS SVRFOwogICAgICAgYnJlYWs7Ci0gICAgZGVmYXVsdDoKLSAgICAgIGVtYWNzX2Fib3J0ICgpOwog ICAgIH0KIAogICBpbnQgbWVtX2ZsYWdzID0gTUFQX1BSSVZBVEUgfCBNQVBfQU5PTllNT1VTOwpA QCAtNDY2MSw3ICs0NjQ3LDYgQEAgZHVtcF9tYXBfZmlsZV93MzIgKHZvaWQgKmJhc2UsIGludCBm ZCwgb2ZmX3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSwKICAgICBjYXNlIERVTVBfTUVNT1JZX0FDQ0VT U19SRUFEV1JJVEU6CiAgICAgICBwcm90ZWN0ID0gUEFHRV9XUklURUNPUFk7CS8qIGZvciBXaW5k b3dzIDlYICovCiAgICAgICBicmVhazsKLSAgICBkZWZhdWx0OgogICAgIGNhc2UgRFVNUF9NRU1P UllfQUNDRVNTX05PTkU6CiAgICAgY2FzZSBEVU1QX01FTU9SWV9BQ0NFU1NfUkVBRDoKICAgICAg IHByb3RlY3QgPSBQQUdFX1JFQURPTkxZOwpAQCAtNDY4OSw4ICs0Njc0LDYgQEAgZHVtcF9tYXBf ZmlsZV93MzIgKHZvaWQgKmJhc2UsIGludCBmZCwgb2ZmX3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSwK ICAgICBjYXNlIERVTVBfTUVNT1JZX0FDQ0VTU19SRUFEV1JJVEU6CiAgICAgICBtYXBfYWNjZXNz ID0gRklMRV9NQVBfQ09QWTsKICAgICAgIGJyZWFrOwotICAgIGRlZmF1bHQ6Ci0gICAgICBlbWFj c19hYm9ydCAoKTsKICAgICB9CiAKICAgcmV0ID0gTWFwVmlld09mRmlsZUV4IChzZWN0aW9uLApA QCAtNDczMyw4ICs0NzE2LDYgQEAgZHVtcF9tYXBfZmlsZV9wb3NpeCAodm9pZCAqYmFzZSwgaW50 IGZkLCBvZmZfdCBvZmZzZXQsIHNpemVfdCBzaXplLAogICAgICAgbWVtX3Byb3QgPSBQUk9UX1JF QUQgfCBQUk9UX1dSSVRFOwogICAgICAgbWVtX2ZsYWdzID0gTUFQX1BSSVZBVEU7CiAgICAgICBi cmVhazsKLSAgICBkZWZhdWx0OgotICAgICAgZW1hY3NfYWJvcnQgKCk7CiAgICAgfQogCiAgIGlm IChiYXNlKQpAQCAtNTYwMSw4ICs1NTgyLDYgQEAgZHVtcF9kb19lbWFjc19yZWxvY2F0aW9uIChj b25zdCB1aW50cHRyX3QgZHVtcF9iYXNlLAogICAgICAgICBtZW1jcHkgKGVtYWNzX3B0cl9hdCAo cmVsb2MuZW1hY3Nfb2Zmc2V0KSwgJmx2LCBzaXplb2YgKGx2KSk7CiAgICAgICAgIGJyZWFrOwog ICAgICAgfQotICAgIGRlZmF1bHQ6Ci0gICAgICBmYXRhbCAoInVucmVjb2duaWVkIHJlbG9jYXRp b24gdHlwZSAlZCIsIChpbnQpIHJlbG9jLnR5cGUpOwogICAgIH0KIH0KIAotLSAKMi40OC4wCgo= --000000000000ac64d6062c19a396--
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 17 Jan 2025 20:48:34 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 17 15:48:34 2025 Received: from localhost ([127.0.0.1]:38991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYtGc-0006KR-7H for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 15:48:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34308) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tYtGY-0006KC-2u for 75451-done <at> debbugs.gnu.org; Fri, 17 Jan 2025 15:48:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tYtGS-0003dg-9W; Fri, 17 Jan 2025 15:48:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=IamQralqQajd2fk2MdLCPdIQU9C7lluafMwjzQjRSqs=; b=TQX8uWFkmyRUsaUD8zWs 0DzvKtjSgrhdiDgIeuz1Vx58jus2lrcbdKiYKGacjlsA18qf8EI6CQHs8H1KR/RN8g+JW5z+ttAM1 uo0R6WNDT5EYq3pliSP45f6Q58nmqiyvRINazpdqjZOQak3qHjbxONtKg3ZxIxfPfiySn1QNxSGvX rxKc3I7luo/X+dHjsC1Or5RHJcaFudZRqXvMI2BPftKve6p4WhSnbr9c2eVzqO6sqDUgAYVN0Hnss v4SKlR6og47PMbxlUMP6b1nKffQ7jv4GstJ30yw67d56lr2Uio/rxFuLfPyEIgCMIZ+bt1bKezTen Y9Ksorh+F9Iizw==; Date: Fri, 17 Jan 2025 22:48:20 +0200 Message-Id: <86tt9xcgkr.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Pip Cet <pipcet@HIDDEN> In-Reply-To: <87plklgza0.fsf@HIDDEN> (message from Pip Cet on Fri, 17 Jan 2025 16:51:04 +0000) Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> <87zfjqkena.fsf@HIDDEN> <CADwFkmkQqV7yZFGPG8+OW51y0zKpo_F+G9XsZw5W_8YDs2YrGQ@HIDDEN> <87plklgza0.fsf@HIDDEN> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75451-done Cc: gerd.moellmann@HIDDEN, gerd@HIDDEN, acorallo@HIDDEN, stefankangas@HIDDEN, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 17 Jan 2025 16:51:04 +0000 > From: Pip Cet <pipcet@HIDDEN> > Cc: Gerd Möllmann <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451-done <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN> > > I initially thought I disagreed with this, but then I saw that > > https://www.gnu.org/software/gawk/ > > uses "gawk", not "awk", so the GNU project no longer claims the "awk" > identifier. If that is incorrect, please let me know. Not sure if this answers the question, but as of the latest release 5.3.1 of Gawk, "make install" installs both 'gawk' and 'awk'.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 17 Jan 2025 19:50:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 17 14:50:47 2025 Received: from localhost ([127.0.0.1]:38897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYsMf-0003Ad-KK for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 14:50:46 -0500 Received: from mail-10629.protonmail.ch ([79.135.106.29]:54449) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tYsMa-0003AC-60 for 75451-done <at> debbugs.gnu.org; Fri, 17 Jan 2025 14:50:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737143432; x=1737402632; bh=LD/ELGVALXE21qEFTfx4kwLOzZwSPSVtSOJ3ZbHaOeE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=v/nWmCkmuWMngBa+1Ad1RRUxKMXTtrH1S3uWuNVirl0n1S4eA6MedlciZ5iVQBBbb 55M7hPh7K7Sb7gyicKJupxPaq8FJRMYbJZCVa0TKufUQ/f9NUS3N7sqsdRD2W3KXRG /N340OgC0JmIyB/bKN39+YKiv/0Hd+Zxx/AAo2dBtzqegqdMg45f08O53Rg3zxt2yN DyumDeo1gBURJfAF2C/fhDLW2YrpKJ0rPRpRSoXhd4kAIONaTf5FmSdLmYuZRSZCeW 8BkdQXYsqlcAIToYsEb7e2Nq//QlCLxOV0TGATmIG35HC5yRYB3KJTbbKaiojiifoG 8rQFt6q+R4Psg== Date: Fri, 17 Jan 2025 19:50:27 +0000 To: Andrea Corallo <acorallo@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <874j1xgqz0.fsf@HIDDEN> In-Reply-To: <yp1ldv933c2.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <yp1ldv933c2.fsf@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: e940e1d0aeb12cca5c2c584b04e53d8b56f1415e MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Andrea Corallo" <acorallo@HIDDEN> writes: > Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" <bug-gnu-emacs@HIDDEN> writes: > >> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: >> >>> Stefan Kangas <stefankangas@HIDDEN> writes: >>> >>>> >>>>> (BTW, the contents of the #if might be out of date, not sure if we >>>>> meanwhile fix/scan additional structs.) >>>> >>>> I've now added checks for all structs that we use in "fix_*" functions >>>> (commit 76a0d739024). I kept notes to make sure I didn't miss anythin= g, >>>> but it's not impossible that I did. I'll double-check things later. >>>> >>>> I plan to do anything passed to the "finalize_*" ones next, which shou= ld >>>> cover most of the ones we currently depend on, I think. >>> >>> Very nice! Thanks for taking this on! >> >> Thanks! >> >> This isn't strictly about the scratch/igc branch, but I personally think >> struct hashes should be checked in all builds, mismatches should be >> downgraded to #warnings, and --enable-checking=3Dall could include >> -Werror=3Dcpp. (So the warnings would still abort a build with >> --enable-checking=3Dall, but they'd *also* show up in regular builds.) >> >> Also, we should include them in the nativecomp ABI hash > > +1 Here's a patch series: 1. fix a minor bug in dmpstruct.awk: it would continue to write lines to dmpstruct.tmp in some cases after generating the hash. This was harmless because the hash was already generated, but it broke my first attempt's code. 2. generate a hash covering all structs. It's not a hash-of-hashes, but it does the same thing. 3. include it in the nativecomp ABI hash. This will cause all .eln files t= o be rebuilt when it is applied! (Unless we win the lottery and hit a hash collision, that is. This is entirely possible because the nativecomp hash is only 32 bits.) 4. always build dmpstruct.h. This will avoid the problematic situation in which Emacs builds on a system, we try to rebuild with --enable-checking=3Dall to catch the bug, and it won't build. 5. Generate an sed script to adjust all hashes. I think Emacs developers are adults (or very precocious children) and can be trusted with this powerful tool. 6. Mark autogenerated files as autogenerated. I see no reason not to do that. 7. Adjust hashes (they changed because of (6)). (Might break the DOS build. I'll check.) Pip commit 40c07936b4ce1dbc6f05137d9d4f69e42b03b37c Author: Pip Cet <pipcet@HIDDEN> ; * src/dmpstruct.awk: Don't print extra lines to dmpstruct.tmp diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk index e5e359e10b7..d95552c6105 100644 --- a/src/dmpstruct.awk +++ b/src/dmpstruct.awk @@ -27,7 +27,7 @@ BEGIN { struct_name =3D $2 close (tmpfile) } -/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^( )?};$/ { +/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^( )?} *(GCALI= GNED_STRUCT)? *;$/ { print $0 > tmpfile } /^( )?} *(GCALIGNED_STRUCT)? *;$/ { commit 2e3ca484f870f2a09153c8cf5aec42c23da1b6a2 Author: Pip Cet <pipcet@HIDDEN> Cover common structs in the nativecomp ABI hash (bug#75451) =20 * src/Makefile.in (dmpstruct.h): Always generate. Make pdumper.o and comp.o depend on it. * src/comp.c (hash_native_abi): Include overall hash in nativecomp ABI hash. * src/dmpstruct.awk: Mark autogenerated files. Generate a hash for all hashed structures. diff --git a/src/Makefile.in b/src/Makefile.in index d987124d29d..c06449748cd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -539,14 +539,14 @@ .PHONY: =20 dmpstruct_headers=3D$(srcdir)/lisp.h $(srcdir)/buffer.h $(srcdir)/itree.h = \ =09$(srcdir)/intervals.h $(srcdir)/charset.h $(srcdir)/bignum.h -ifeq ($(CHECK_STRUCTS),true) -pdumper.o: dmpstruct.h -endif dmpstruct.h: $(srcdir)/dmpstruct.awk dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) =09$(AM_V_GEN)POSIXLY_CORRECT=3D1 $(AWK) -f $(srcdir)/dmpstruct.awk \ =09=09$(dmpstruct_headers) > $@ =20 +pdumper.o: dmpstruct.h +comp.o: dmpstruct.h + AUTO_DEPEND =3D @AUTO_DEPEND@ DEPDIR =3D deps ifeq ($(AUTO_DEPEND),yes) diff --git a/src/comp.c b/src/comp.c index 2603a2f4334..12743af8e01 100644 --- a/src/comp.c +++ b/src/comp.c @@ -40,6 +40,7 @@ #include "md5.h" #include "sysstdio.h" #include "zlib.h" +#include "dmpstruct.h" =20 =20 /********************************/ @@ -796,11 +797,14 @@ hash_native_abi (void) =20 Vcomp_abi_hash =3D comp_hash_string ( - concat3 (build_string (ABI_VERSION), -=09 concat3 (Vemacs_version, Vsystem_configuration, -=09=09=09Vsystem_configuration_options), -=09 Fmapconcat (intern_c_string ("comp--subr-signature"), -=09=09=09 Vcomp_subr_list, build_string ("")))); + CALLN (Fconcat, +=09 build_string (ABI_VERSION), +=09 Vemacs_version, +=09 Vsystem_configuration, +=09 Vsystem_configuration_options, +=09 build_string (HASH_DMPSTRUCT), +=09 Fmapconcat (intern_c_string ("comp--subr-signature"), +=09=09=09 Vcomp_subr_list, build_string ("")))); =20 Lisp_Object version =3D Vemacs_version; =20 diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk index d95552c6105..f00d7fd0136 100644 --- a/src/dmpstruct.awk +++ b/src/dmpstruct.awk @@ -21,6 +21,8 @@ BEGIN { print "#define EMACS_DMPSTRUCT_H" struct_name =3D "" tmpfile =3D "dmpstruct.tmp" + tmpfile_all =3D "dmpstruct-all.tmp" + print "/* AUTOGENERATED. DO NOT EDIT. This file is used for generating = the HASH_DMPSTRUCT hash. */" > tmpfile_all } # Match a type followed by optional syntactic whitespace /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ { @@ -28,7 +30,9 @@ BEGIN { close (tmpfile) } /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^( )?} *(GCALI= GNED_STRUCT)? *;$/ { - print $0 > tmpfile + print "/* AUTOGENERATED. DO NOT EDIT. This file is used for generating = a dmpstruct hash. */" > tmpfile + print $0 >> tmpfile + print $0 >> tmpfile_all } /^( )?} *(GCALIGNED_STRUCT)? *;$/ { if (struct_name !=3D "") { @@ -41,5 +45,11 @@ BEGIN { } } END { + fflush (tmpfile_all) + cmd =3D "../lib-src/make-fingerprint -r " tmpfile_all + cmd | getline hash + close (cmd) + printf "#define HASH_%s_%.12s\n", "dmpstruct", hash + printf "#define HASH_DMPSTRUCT \"%.12s\"\n", hash print "#endif /* EMACS_DMPSTRUCT_H */" } commit 29ce0f65c0cb9781d173c2ad5229626ffa55cc3a Author: Pip Cet <pipcet@HIDDEN> Generate an SED script to adjust dmpstruct values (bug#75451) =20 * configure.ac: Adjust config.h comment. * src/dmpstruct.awk: Create SED file. * src/Makefile.in (fix-hashes): New target. diff --git a/configure.ac b/configure.ac index 936afc0e7df..5ed9ae7a7fe 100644 --- a/configure.ac +++ b/configure.ac @@ -755,9 +755,9 @@ AC_DEFUN AC_DEFINE([CHECK_STRUCTS], [1], [Define this to check whether someone updated the portable dumper code after changing the layout of a structure that it uses. - If you change one of these structures, check that the pdumper.c - code is still valid, and update the pertinent hash in pdumper.c - by manually copying the hash from the newly-generated dmpstruct.h.]= ) + If you change one of these structures, check that the relevant + code is still valid, and update the pertinent hash by running + sed -f src/dmpstruct.sed.tmp on the right file.]) fi AC_SUBST([CHECK_STRUCTS]) if test x$ac_gc_check_stringbytes !=3D x ; then diff --git a/src/Makefile.in b/src/Makefile.in index c06449748cd..0402f96c42f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1027,3 +1027,6 @@ $(bootstrap_pdmp): check-syntax: =09$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) ${CHK_SOURCES} || true .PHONY: check-syntax + +fix-hashes: dmpstruct.h +=09sed -f dmpstruct.sed.tmp -i pdumper.c diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk index f00d7fd0136..00de127611f 100644 --- a/src/dmpstruct.awk +++ b/src/dmpstruct.awk @@ -22,7 +22,9 @@ BEGIN { struct_name =3D "" tmpfile =3D "dmpstruct.tmp" tmpfile_all =3D "dmpstruct-all.tmp" + sedfile =3D "dmpstruct.sed.tmp" print "/* AUTOGENERATED. DO NOT EDIT. This file is used for generating = the HASH_DMPSTRUCT hash. */" > tmpfile_all + print "# AUTOGENERATED. DO NOT EDIT. This file is used for adjusting ha= shes." > sedfile } # Match a type followed by optional syntactic whitespace /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ { @@ -41,6 +43,7 @@ BEGIN { cmd | getline hash close (cmd) printf "#define HASH_%s_%.10s\n", struct_name, hash + printf "s/HASH_%s_[0-9A-Fa-f]*/HASH_%s_%.10s/g\n", struct_name, struct= _name, hash >> sedfile struct_name =3D "" } } commit 1c5505558d49962a95202a777c53cc6f2a9a75f4 (HEAD -> bug75451) Author: Pip Cet <pipcet@HIDDEN> Adjust changed dmpstruct hashes (bug#75451) diff --git a/src/pdumper.c b/src/pdumper.c index 97d3d1412b7..a4765dfd38e 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2000,7 +2000,7 @@ dump_pseudovector_lisp_fields (struct dump_context *c= tx, static dump_off dump_cons (struct dump_context *ctx, const struct Lisp_Cons *cons) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Cons_00EEE63F67) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Cons_EF7EE95CF6) # error "Lisp_Cons changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Cons out; @@ -2015,7 +2015,7 @@ dump_interval_tree (struct dump_context *ctx, INTERVAL tree, dump_off parent_offset) { -#if CHECK_STRUCTS && !defined (HASH_interval_1B38941C37) +#if CHECK_STRUCTS && !defined (HASH_interval_858621D7FE) # error "interval changed. See CHECK_STRUCTS comment in config.h." #endif /* TODO: output tree breadth-first? */ @@ -2059,7 +2059,7 @@ dump_interval_tree (struct dump_context *ctx, static dump_off dump_string (struct dump_context *ctx, const struct Lisp_String *string) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_String_03B2DF1C8E) +#if CHECK_STRUCTS && !defined (HASH_Lisp_String_C136309593) # error "Lisp_String changed. See CHECK_STRUCTS comment in config.h." #endif /* If we have text properties, write them _after_ the string so that @@ -2105,7 +2105,7 @@ dump_string (struct dump_context *ctx, const struct L= isp_String *string) static dump_off dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Marker_642DBAF866) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Marker_AC394EFE74) # error "Lisp_Marker changed. See CHECK_STRUCTS comment in config.h." #endif =20 @@ -2128,7 +2128,7 @@ dump_marker (struct dump_context *ctx, const struct L= isp_Marker *marker) static dump_off dump_interval_node (struct dump_context *ctx, struct itree_node *node) { -#if CHECK_STRUCTS && !defined (HASH_itree_node_03626AFCA9) +#if CHECK_STRUCTS && !defined (HASH_itree_node_4EBE12CCEE) # error "itree_node changed. See CHECK_STRUCTS comment in config.h." #endif struct itree_node out; @@ -2170,7 +2170,7 @@ dump_interval_node (struct dump_context *ctx, struct = itree_node *node) static dump_off dump_overlay (struct dump_context *ctx, const struct Lisp_Overlay *overlay= ) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Overlay_5F9D7E02FC) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Overlay_55E80432A2) # error "Lisp_Overlay changed. See CHECK_STRUCTS comment in config.h." #endif START_DUMP_PVEC (ctx, &overlay->header, struct Lisp_Overlay, out); @@ -2202,7 +2202,7 @@ dump_field_finalizer_ref (struct dump_context *ctx, dump_finalizer (struct dump_context *ctx, const struct Lisp_Finalizer *finalizer) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Finalizer_D58E647CB8) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Finalizer_F93576AA23) # error "Lisp_Finalizer changed. See CHECK_STRUCTS comment in config.h." #endif START_DUMP_PVEC (ctx, &finalizer->header, struct Lisp_Finalizer, out); @@ -2239,7 +2239,7 @@ dump_treesit_compiled_query (struct dump_context *ctx= , static dump_off dump_bignum (struct dump_context *ctx, Lisp_Object object) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Bignum_661945DE2B) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Bignum_E044A28F86) # error "Lisp_Bignum changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Bignum *bignum =3D XBIGNUM (object); @@ -2277,7 +2277,7 @@ dump_bignum (struct dump_context *ctx, Lisp_Object s= tatic dump_off dump_float (struct dump_context *ctx, const struct Lisp_Float *lfloat) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Float_7E7D284C02) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Float_E025D05C8C) # error "Lisp_Float changed. See CHECK_STRUCTS comment in config.h." #endif eassert (ctx->header.cold_start); @@ -2290,7 +2290,7 @@ dump_float (struct dump_context *ctx, const struct Li= sp_Float *lfloat) static dump_off dump_fwd_int (struct dump_context *ctx, const struct Lisp_Intfwd *intfwd) { -#if CHECK_STRUCTS && !defined HASH_Lisp_Intfwd_4D887A7387 +#if CHECK_STRUCTS && !defined HASH_Lisp_Intfwd_6E2E07BDCC # error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h." #endif dump_emacs_reloc_immediate_intmax_t (ctx, intfwd->intvar, *intfwd->intva= r); @@ -2304,7 +2304,7 @@ dump_fwd_int (struct dump_context *ctx, const struct = Lisp_Intfwd *intfwd) static dump_off dump_fwd_bool (struct dump_context *ctx, const struct Lisp_Boolfwd *boolfw= d) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Boolfwd_0EA1C7ADCC) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Boolfwd_4BDBCBC7D2) # error "Lisp_Boolfwd changed. See CHECK_STRUCTS comment in config.h." #endif dump_emacs_reloc_immediate_bool (ctx, boolfwd->boolvar, *boolfwd->boolva= r); @@ -2318,7 +2318,7 @@ dump_fwd_bool (struct dump_context *ctx, const struct= Lisp_Boolfwd *boolfwd) static dump_off dump_fwd_obj (struct dump_context *ctx, const struct Lisp_Objfwd *objfwd) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Objfwd_45D3E513DC) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Objfwd_33156D0D7A) # error "Lisp_Objfwd changed. See CHECK_STRUCTS comment in config.h." #endif if (NILP (Fgethash (dump_off_to_lisp (emacs_offset (objfwd->objvar)), @@ -2336,7 +2336,7 @@ dump_fwd_obj (struct dump_context *ctx, const struct = Lisp_Objfwd *objfwd) dump_fwd_buffer_obj (struct dump_context *ctx, const struct Lisp_Buffer_Objfwd *buffer_objfwd) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Buffer_Objfwd_611EBD13FF) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Buffer_Objfwd_AF869E0C7C) # error "Lisp_Buffer_Objfwd changed. See CHECK_STRUCTS comment in config.h= ." #endif struct Lisp_Buffer_Objfwd out; @@ -2352,7 +2352,7 @@ dump_fwd_buffer_obj (struct dump_context *ctx, dump_fwd_kboard_obj (struct dump_context *ctx, const struct Lisp_Kboard_Objfwd *kboard_objfwd) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Kboard_Objfwd_CAA7E71069) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Kboard_Objfwd_49A54EE796) # error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Kboard_Objfwd out; @@ -2365,7 +2365,7 @@ dump_fwd_kboard_obj (struct dump_context *ctx, static dump_off dump_fwd (struct dump_context *ctx, lispfwd fwd) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Fwd_Type_9CBA6EE55E) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Fwd_Type_010C8CEF02) # error "Lisp_Fwd_Type changed. See CHECK_STRUCTS comment in config.h." #endif void const *p =3D fwd.fwdptr; @@ -2399,7 +2399,7 @@ dump_fwd (struct dump_context *ctx, lispfwd fwd) dump_blv (struct dump_context *ctx, const struct Lisp_Buffer_Local_Value *blv) { -#if CHECK_STRUCTS && !defined HASH_Lisp_Buffer_Local_Value_3C363FAC3C +#if CHECK_STRUCTS && !defined HASH_Lisp_Buffer_Local_Value_BC9625B82F # error "Lisp_Buffer_Local_Value changed. See CHECK_STRUCTS comment in con= fig.h." #endif struct Lisp_Buffer_Local_Value out; @@ -2465,10 +2465,10 @@ dump_symbol (struct dump_context *ctx, Lisp_Object object, dump_off offset) { -#if CHECK_STRUCTS && !defined HASH_Lisp_Symbol_61B174C9F4 +#if CHECK_STRUCTS && !defined HASH_Lisp_Symbol_A10971AE16 # error "Lisp_Symbol changed. See CHECK_STRUCTS comment in config.h." #endif -#if CHECK_STRUCTS && !defined (HASH_symbol_redirect_EA72E4BFF5) +#if CHECK_STRUCTS && !defined (HASH_symbol_redirect_F62BD8F1FE) # error "symbol_redirect changed. See CHECK_STRUCTS comment in config.h." #endif =20 @@ -2562,7 +2562,7 @@ dump_symbol (struct dump_context *ctx, dump_vectorlike_generic (struct dump_context *ctx, =09=09=09 const union vectorlike_header *header) { -#if CHECK_STRUCTS && !defined (HASH_vectorlike_header_785E52047B) +#if CHECK_STRUCTS && !defined (HASH_vectorlike_header_331153C5E8) # error "vectorlike_header changed. See CHECK_STRUCTS comment in config.h.= " #endif const struct Lisp_Vector *v =3D (const struct Lisp_Vector *) header; @@ -2734,7 +2734,7 @@ dump_hash_table_contents (struct dump_context *ctx, s= truct Lisp_Hash_Table *h) static dump_off dump_hash_table (struct dump_context *ctx, Lisp_Object object) { -#if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_0360833954 +#if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_E855664723 # error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Hash_Table *hash_in =3D XHASH_TABLE (object); @@ -2789,7 +2789,7 @@ dump_obarray_buckets (struct dump_context *ctx, const= struct Lisp_Obarray *o) static dump_off dump_obarray (struct dump_context *ctx, Lisp_Object object) { -#if CHECK_STRUCTS && !defined HASH_Lisp_Obarray_D2757E61AD +#if CHECK_STRUCTS && !defined HASH_Lisp_Obarray_552E55F2A1 # error "Lisp_Obarray changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Obarray *in_oa =3D XOBARRAY (object); @@ -2811,7 +2811,7 @@ dump_obarray (struct dump_context *ctx, Lisp_Object o= bject) static dump_off dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) { -#if CHECK_STRUCTS && !defined HASH_buffer_B02F648B82 +#if CHECK_STRUCTS && !defined HASH_buffer_2562CF7465 # error "buffer changed. See CHECK_STRUCTS comment in config.h." #endif struct buffer munged_buffer =3D *in_buffer; @@ -2949,7 +2949,7 @@ dump_buffer (struct dump_context *ctx, const struct b= uffer *in_buffer) static dump_off dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Vector_3091289B35) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Vector_FBEF167750) # error "Lisp_Vector changed. See CHECK_STRUCTS comment in config.h." #endif /* No relocation needed, so we don't need dump_object_start. */ @@ -2966,7 +2966,7 @@ dump_bool_vector (struct dump_context *ctx, const str= uct Lisp_Vector *v) static dump_off dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_EE5F7351CC) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_1B888CFDDA) # error "Lisp_Subr changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Subr out; @@ -3065,7 +3065,7 @@ dump_vectorlike (struct dump_context *ctx, Lisp_Object lv, dump_off offset) { -#if CHECK_STRUCTS && !defined HASH_pvec_type_99104541E2 +#if CHECK_STRUCTS && !defined HASH_pvec_type_933496B918 # error "pvec_type changed. See CHECK_STRUCTS comment in config.h." #endif const struct Lisp_Vector *v =3D XVECTOR (lv); @@ -3172,7 +3172,7 @@ dump_vectorlike (struct dump_context *ctx, static dump_off dump_object (struct dump_context *ctx, Lisp_Object object) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_45F0582FD7) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_2A0F47A74F) # error "Lisp_Type changed. See CHECK_STRUCTS comment in config.h." #endif eassert (!EQ (object, dead_object ())); @@ -3275,7 +3275,7 @@ dump_object_for_offset (struct dump_context *ctx, Lis= p_Object object) static dump_off dump_charset (struct dump_context *ctx, int cs_i) { -#if CHECK_STRUCTS && !defined (HASH_charset_E31F4B5D96) +#if CHECK_STRUCTS && !defined (HASH_charset_DDAF793226) # error "charset changed. See CHECK_STRUCTS comment in config.h." #endif /* We can't change the alignment here, because ctx->offset is what
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 17 Jan 2025 16:51:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 17 11:51:21 2025 Received: from localhost ([127.0.0.1]:38670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYpZ2-0007DX-UV for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:51:21 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:44699) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tYpYz-0007Cv-Cx for 75451-done <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:51:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737132669; x=1737391869; bh=UxZuqIQe/I0utYIfD2t+52OxH7Jr4d9VYCagZip809E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=eb76TjKX1t7SRn+xss0sQQYWPukvtWoifzuYJOm/xxgqXmJUl60KgtGpsLWe+bDrZ 2mvtOJL17RpZj1jvZxhXWgkGM/xA7Z/Q5EMGzEXqNxSq1qZCL9HIwphZOmPN6/D1vg 6mV9Bw93hq8Vlj0ZOB4o9KPNi70ue5D2FqArRLbGW1iItWiXS5OcVDUQUZ3/Fl2rFK 8wJvnYpw+2ix6xGFGPmWh5tGr4tyoxZ2tTsgLfPjDc7RX+lWlBOcaILdiDDeRnHqm2 zTmwz2+UfwTHBkE/Psn8J4X5XmyHhudoxiJ/Qtti6yssVuTqZdEHO7ae8BjXXfvMpp oJJzBG7C8O9/w== Date: Fri, 17 Jan 2025 16:51:04 +0000 To: Stefan Kangas <stefankangas@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87plklgza0.fsf@HIDDEN> In-Reply-To: <CADwFkmkQqV7yZFGPG8+OW51y0zKpo_F+G9XsZw5W_8YDs2YrGQ@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> <87zfjqkena.fsf@HIDDEN> <CADwFkmkQqV7yZFGPG8+OW51y0zKpo_F+G9XsZw5W_8YDs2YrGQ@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: fcc9de1e3ce62a3c7d795c5971cc9bd63e9193f6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Stefan Kangas" <stefankangas@HIDDEN> writes: > Pip Cet <pipcet@HIDDEN> writes: >> diff --git a/configure.ac b/configure.ac >> index f78997ede24..269cbf70b60 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -2004,6 +2004,8 @@ AC_DEFUN >> >> dnl Some other nice autoconf tests. >> AC_PROG_INSTALL >> +dnl use "gawk", not "awk", where appropriate >> +AC_PROG_AWK > > Should this perhaps say > > dnl use "gawk" where possible > > instead? Done. I initially thought I disagreed with this, but then I saw that https://www.gnu.org/software/gawk/ uses "gawk", not "awk", so the GNU project no longer claims the "awk" identifier. If that is incorrect, please let me know. Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 17 Jan 2025 16:36:59 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 17 11:36:58 2025 Received: from localhost ([127.0.0.1]:38639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYpL8-0006Rp-AB for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:36:58 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:49586) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tYpL2-0006RI-MC for 75451-done <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:36:56 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5da135d3162so3792597a12.3 for <75451-done <at> debbugs.gnu.org>; Fri, 17 Jan 2025 08:36:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737131806; x=1737736606; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=/GiCgG5E9mfNHC9f0KstWSSiQG88rs9X+G0v8ci33nc=; b=VZZG83XILr7Rit1mQ0rnswGqt86wYFUBStWWoDcswEUmQ7y8Z89rHmEE/C/z2fvPJM 3Kc5qDBdNNFyawIHJJ9ZKTwPiE72pw5EooBAiKtDoMoNkhPdlSRFcS3H/98g0VKZ6NnP 0Yc1JNJdUZggS2CXxTDohvLNyYg2V9jlkWGA3d1mVHmBU+KpspbP0EmBkdU/k0u6qIDc ptPeQvL5hr2S3KBKQ9oCemodvQDKciUA6CCjfLB0qDfxT6sOP7Ii+n11sSyGL5I/XE/U KnCu9WnT0XwsHYXGiktuPcEQuHKXH/FuhUbQ11JBVcy4akgFanxmcWT+iHy/+wUzGf75 L9RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737131806; x=1737736606; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/GiCgG5E9mfNHC9f0KstWSSiQG88rs9X+G0v8ci33nc=; b=ojSh4f96TClUl9sTbAPl+ceB5l/NQfmSKNN5eAMFgUaoSrnTaXxEWYvUnDalYzVbEg 5JuV1tu1lbDbwote757oTYtXRGnNpuQmjMmWEChEpAA0E1HJ+vkGK+Hq//d7uYC8WmcP OPFRIMEQ4NaVVIo6Rq3CP+thr3EN7WotKu5J3jtSxjOO6pgezk0TYf9Wnngov27cW1li xLq4Rb4XRr//7zqmIjvWSq2G426Wy0LoWkt+J3UwbzEOzvGi9fn33zgddZxN1ZoVY3mu FGsr3bcl0Y/a0iXWUSd8Lrg6lbhWx6qJvkPjnryGnEzDmj3+ts8G3XMA4y7YCTaoBtaY DkmA== X-Forwarded-Encrypted: i=1; AJvYcCVjxkjvaZF9XDB+g8T+3oRrYTnypmZTrymxeSBmI7w6XMliGlVxTixKsNdNfzId7ZAfanQ/31z8vkry <at> debbugs.gnu.org X-Gm-Message-State: AOJu0YxpfzrSAKa0kaMPlDe+HjPN9sgPoaSv1E3H+aIMCsp/GKxn27tK 17LsNbrN+tpbcNeX8UzUz64Dk5DWZmohJJOGXkf8UiW0FS8+21bx8pxDYYIhNfK+juRoHuyNxlQ zuvpZzE6yt5pswNLLmss2IjXPl7U= X-Gm-Gg: ASbGnctzIYhXOWJnsFOcr5QghPg23a5UD0d9cLqzgOxMxjV5sKo7vrPhxOBxUKNXAkc QnlSYkmZBP8zNdO7f0QnvKLgGV8RcpBnsBNUP4Yk= X-Google-Smtp-Source: AGHT+IFFXv3llZVGb2POJ1cRUNdzEy+GvOxhoFtFdhYW8cAaf3w6lEkJIMSE9VhSBZp0oRk5UU7Qw8ddoUDZLOIfPto= X-Received: by 2002:a05:6402:2681:b0:5d0:bcdd:ff9c with SMTP id 4fb4d7f45d1cf-5db7d2dc2admr3158998a12.2.1737131805379; Fri, 17 Jan 2025 08:36:45 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 17 Jan 2025 08:36:45 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87zfjqkena.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> <87zfjqkena.fsf@HIDDEN> MIME-Version: 1.0 Date: Fri, 17 Jan 2025 08:36:45 -0800 X-Gm-Features: AbW1kvZ7v2Ka3TLDc88sWunDDbVTWTy23VuiF90Z2mdXEH9n7IAcvJZ0U-Dh4Sg Message-ID: <CADwFkmkQqV7yZFGPG8+OW51y0zKpo_F+G9XsZw5W_8YDs2YrGQ@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: > You're right. Let's start by fixing the build on Solaris 10. > > Here's a WIP patch which *almost* fixes the build (with > --enable-checking=all) there. The problem is that "ar" doesn't work, > and AC_PROG_AR, which I naively assumed would define @AR@, doesn't exist > either, on that system. So you still have to build with "gmake AR=gar", > I guess. (I also have to trick the makeinfo detection into letting me > build Emacs, but that's a well-known unrelated problem). LGTM with an optional nit below. > commit 738f12b467016e59086bad7c38f86b59b85f662e (HEAD) > Author: Pip Cet <pipcet@HIDDEN> > Date: Thu Jan 16 13:42:03 2025 +0000 > > Fix build on Solaris 10 (bug#75451) > > * autogen.sh: Avoid bashism. > * configure.ac (AC_PROG_AWK): Use. > * src/Makefile.in (AWK): Set. > (dmpstruct.h): Use "$(AWK)", not "awk". > * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LNK): Define all three constants > or none of them. > > diff --git a/autogen.sh b/autogen.sh > index 00c20c73263..3d641b6e1f9 100755 > --- a/autogen.sh > +++ b/autogen.sh > @@ -115,7 +115,7 @@ do_check= > do_autoconf=false > do_git=false > > -for arg; do > +for arg in "$@"; do > case $arg in > --help) > exec echo "$0: usage: $0 [--no-check] [target...] > diff --git a/configure.ac b/configure.ac > index f78997ede24..269cbf70b60 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -2004,6 +2004,8 @@ AC_DEFUN > > dnl Some other nice autoconf tests. > AC_PROG_INSTALL > +dnl use "gawk", not "awk", where appropriate > +AC_PROG_AWK Should this perhaps say dnl use "gawk" where possible instead? > dnl These are commented out, since gl_EARLY and/or Autoconf already does them. > dnl AC_PROG_MKDIR_P > dnl if test "x$RANLIB" = x; then > diff --git a/src/Makefile.in b/src/Makefile.in > index 784aadd1689..d987124d29d 100644 > --- a/src/Makefile.in > +++ b/src/Makefile.in > @@ -60,6 +60,7 @@ LDFLAGS = > EXEEXT = @EXEEXT@ > version = @version@ > MKDIR_P = @MKDIR_P@ > +AWK = @AWK@ > # Don't use LIBS. configure puts stuff in it that either shouldn't be > # linked with Emacs or is duplicated by the other stuff below. > # LIBS = @LIBS@ > @@ -543,7 +544,7 @@ pdumper.o: > endif > dmpstruct.h: $(srcdir)/dmpstruct.awk > dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) > - $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \ > + $(AM_V_GEN)POSIXLY_CORRECT=1 $(AWK) -f $(srcdir)/dmpstruct.awk \ > $(dmpstruct_headers) > $@ > > AUTO_DEPEND = @AUTO_DEPEND@ > diff --git a/src/dired.c b/src/dired.c > index 89d6033f9b9..bff83ca0c95 100644 > --- a/src/dired.c > +++ b/src/dired.c > @@ -79,7 +79,15 @@ dirent_namelen (struct dirent *dp) > } > > #ifndef HAVE_STRUCT_DIRENT_D_TYPE > -enum { DT_UNKNOWN, DT_DIR, DT_LNK }; > +enum { > +#if !defined (DT_UNKNOWN) && !defined (DT_DIR) && !defined (DT_LNK) > + DT_UNKNOWN, > + DT_DIR, > + DT_LNK, > +#elif defined (DT_UNKNOWN) || defined (DT_DIR) || defined (DT_LNK) > +#error "Cannot determine DT_UNKNOWN, DT_DIR, DT_LNK" > +#endif > +}; > #endif > > /* Return the file type of DP. */
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 17 Jan 2025 14:47:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 17 09:47:05 2025 Received: from localhost ([127.0.0.1]:36545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYncn-0000Vp-8t for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 09:47:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45276) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <acorallo@HIDDEN>) id 1tYncl-0000VC-A3 for 75451-done <at> debbugs.gnu.org; Fri, 17 Jan 2025 09:47:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <acorallo@HIDDEN>) id 1tYncf-00054k-K2; Fri, 17 Jan 2025 09:46:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=14PxPtP/3jJ5uoKDtT+V4/BS5oSjeo1jIu/twF6UjeE=; b=l5VWjupdiptUUFVPopDH uMekVyJZ6CYrsDlZAIgAsgwwOM2pYRRs1k0POdf231XxIZZ5reRt3YVpTD28mm01kNuPOyd1T0sE0 8aV2YfVS4n95h3XzAqKJCvwxIThqfAmPzlSMfnLztWcJtjRcJ+wS5CjFxq3rtJum9hJsXPODq6zOh 9eUABKUxQJJGSjaWNeZS/MpiZFKEBhWqZwCyDZmI2MidSznTcf9mIFDnF79aempFjdPrOECLodz5S 11Z4jDZUgxBGFOcJ5joWE/5h+QfZwEEHK8NhUEEW3WyKW11RG7GP8t0LfICkUtqLmd5aH7cXXneZ2 5Ng/m4hPiiVg6g==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from <acorallo@HIDDEN>) id 1tYncf-0000ZN-0r; Fri, 17 Jan 2025 09:46:57 -0500 From: Andrea Corallo <acorallo@HIDDEN> To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <87frls47uu.fsf@HIDDEN> (Pip Cet via's message of "Thu, 09 Jan 2025 10:09:00 +0000") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> Date: Fri, 17 Jan 2025 09:46:53 -0500 Message-ID: <yp1ldv933c2.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75451-done Cc: Pip Cet <pipcet@HIDDEN>, 75451-done <at> debbugs.gnu.org, Gerd Moellmann <gerd@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes: > Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: > >> Stefan Kangas <stefankangas@HIDDEN> writes: >> >>> >>>> (BTW, the contents of the #if might be out of date, not sure if we >>>> meanwhile fix/scan additional structs.) >>> >>> I've now added checks for all structs that we use in "fix_*" functions >>> (commit 76a0d739024). I kept notes to make sure I didn't miss anything, >>> but it's not impossible that I did. I'll double-check things later. >>> >>> I plan to do anything passed to the "finalize_*" ones next, which should >>> cover most of the ones we currently depend on, I think. >> >> Very nice! Thanks for taking this on! > > Thanks! > > This isn't strictly about the scratch/igc branch, but I personally think > struct hashes should be checked in all builds, mismatches should be > downgraded to #warnings, and --enable-checking=3Dall could include > -Werror=3Dcpp. (So the warnings would still abort a build with > --enable-checking=3Dall, but they'd *also* show up in regular builds.) > > Also, we should include them in the nativecomp ABI hash +1
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 16 Jan 2025 14:38:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 16 09:38:48 2025 Received: from localhost ([127.0.0.1]:60565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tYR1D-0000A0-Bj for submit <at> debbugs.gnu.org; Thu, 16 Jan 2025 09:38:47 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:24171) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tYR1A-00009b-Dz for 75451-done <at> debbugs.gnu.org; Thu, 16 Jan 2025 09:38:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737038317; x=1737297517; bh=OFzc8yzt87rw2NEzWr5z6FrMJ1zy5RsPLdKJe12ki3Q=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=zHv8NQAJ+Nxs0/i0ZtGE7EBNo+OPfui0e+lFENxGxk7luffGwchc+Q36rcdBJKkKc DM80+47eobzSNiejaD99O4zwCAxBVe4WzfdjsMAxWyzdX/WsUF3vFvFruNKQK4yxmP SzpS4+lzTFwubJcCj6vlzr4R6lzLFRGraQO8MSkfeqiklAbw1lKMgV6YziuiPjAiuw xgfCiNbxIYzDsmEFf4YjPXOrdCqd7RLeZqP1wOBV1WFfdgza7TR2Xv/YAcISWYPIwq K1UdmStyex15jYm4omiAFr/xZN1EzYutV39i8c8dTvgDyYjGv0NnI2BAduj0nh7JUc 01d5uOuXerZeQ== Date: Thu, 16 Jan 2025 14:38:31 +0000 To: Stefan Kangas <stefankangas@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87zfjqkena.fsf@HIDDEN> In-Reply-To: <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: dfc697fd5c4bbfc8ae06763e688564034e6c75fa MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 75451-done Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.8 (--) "Stefan Kangas" <stefankangas@HIDDEN> writes: > Pip Cet <pipcet@HIDDEN> writes: > >> This isn't strictly about the scratch/igc branch, but I personally think >> struct hashes should be checked in all builds, mismatches should be >> downgraded to #warnings, and --enable-checking=3Dall could include >> -Werror=3Dcpp. (So the warnings would still abort a build with >> --enable-checking=3Dall, but they'd *also* show up in regular builds.) > > Sounds good to me. > >> Also, we should include them in the nativecomp ABI hash, as nativecomp >> relies on struct layout and the tagging scheme in nontrivial ways >> (most-positive-fixnum, for example, is treated as a compile-time >> constant by comp.el, but I'm not sure all changes to it would >> automatically affect the comp abi hash). > > I'm copying in Andrea for this part. > >> Changes required might include: >> >> * autodetection of gawk vs awk (I think this simply means using $(AWK) >> rather than "awk" in src/Makefile.in; this is important on some >> machines which provide a very different "awk") > > Using $(AWK) instead of raw "awk" makes sense, because why not. > > But which awk implementations are you concerned about more specifically? > I would expect us to just use POSIX awk, without any gawk extensions. > For example, I have had no issues building on Debian (using mawk by > default) or macOS (with the BSD awk that descends from nawk, IIUC). > >> * igc.o and comp.o should depend explicitly on dmpstruct.h (this is >> important for re-builds; in theory, the current scratch/igc branch is >> broken for highly parallel builds because dmpstruct.h might be >> generated after igc.o, but that is not important). > > Sounds good also. > >> * a hash-of-hashes for nativecomp >> >> Proposed partial patch: > > (I didn't look at the patch yet, though the above sounds like it might > come out to more than one patch.) You're right. Let's start by fixing the build on Solaris 10. Here's a WIP patch which *almost* fixes the build (with --enable-checking=3Dall) there. The problem is that "ar" doesn't work, and AC_PROG_AR, which I naively assumed would define @AR@, doesn't exist either, on that system. So you still have to build with "gmake AR=3Dgar", I guess. (I also have to trick the makeinfo detection into letting me build Emacs, but that's a well-known unrelated problem). commit 738f12b467016e59086bad7c38f86b59b85f662e (HEAD) Author: Pip Cet <pipcet@HIDDEN> Date: Thu Jan 16 13:42:03 2025 +0000 Fix build on Solaris 10 (bug#75451) =20 * autogen.sh: Avoid bashism. * configure.ac (AC_PROG_AWK): Use. * src/Makefile.in (AWK): Set. (dmpstruct.h): Use "$(AWK)", not "awk". * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LNK): Define all three constants or none of them. diff --git a/autogen.sh b/autogen.sh index 00c20c73263..3d641b6e1f9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -115,7 +115,7 @@ do_check=3D do_autoconf=3Dfalse do_git=3Dfalse =20 -for arg; do +for arg in "$@"; do case $arg in --help) =09exec echo "$0: usage: $0 [--no-check] [target...] diff --git a/configure.ac b/configure.ac index f78997ede24..269cbf70b60 100644 --- a/configure.ac +++ b/configure.ac @@ -2004,6 +2004,8 @@ AC_DEFUN =20 dnl Some other nice autoconf tests. AC_PROG_INSTALL +dnl use "gawk", not "awk", where appropriate +AC_PROG_AWK dnl These are commented out, since gl_EARLY and/or Autoconf already does t= hem. dnl AC_PROG_MKDIR_P dnl if test "x$RANLIB" =3D x; then diff --git a/src/Makefile.in b/src/Makefile.in index 784aadd1689..d987124d29d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -60,6 +60,7 @@ LDFLAGS =3D EXEEXT =3D @EXEEXT@ version =3D @version@ MKDIR_P =3D @MKDIR_P@ +AWK =3D @AWK@ # Don't use LIBS. configure puts stuff in it that either shouldn't be # linked with Emacs or is duplicated by the other stuff below. # LIBS =3D @LIBS@ @@ -543,7 +544,7 @@ pdumper.o: endif dmpstruct.h: $(srcdir)/dmpstruct.awk dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) -=09$(AM_V_GEN)POSIXLY_CORRECT=3D1 awk -f $(srcdir)/dmpstruct.awk \ +=09$(AM_V_GEN)POSIXLY_CORRECT=3D1 $(AWK) -f $(srcdir)/dmpstruct.awk \ =09=09$(dmpstruct_headers) > $@ =20 AUTO_DEPEND =3D @AUTO_DEPEND@ diff --git a/src/dired.c b/src/dired.c index 89d6033f9b9..bff83ca0c95 100644 --- a/src/dired.c +++ b/src/dired.c @@ -79,7 +79,15 @@ dirent_namelen (struct dirent *dp) } =20 #ifndef HAVE_STRUCT_DIRENT_D_TYPE -enum { DT_UNKNOWN, DT_DIR, DT_LNK }; +enum { +#if !defined (DT_UNKNOWN) && !defined (DT_DIR) && !defined (DT_LNK) + DT_UNKNOWN, + DT_DIR, + DT_LNK, +#elif defined (DT_UNKNOWN) || defined (DT_DIR) || defined (DT_LNK) +#error "Cannot determine DT_UNKNOWN, DT_DIR, DT_LNK" +#endif +}; #endif =20 /* Return the file type of DP. */
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 14 Jan 2025 21:44:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 14 16:44:14 2025 Received: from localhost ([127.0.0.1]:56002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tXohp-0000Mf-Gp for submit <at> debbugs.gnu.org; Tue, 14 Jan 2025 16:44:14 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]:25663) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tXohm-0000MN-8P for 75451 <at> debbugs.gnu.org; Tue, 14 Jan 2025 16:44:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736891043; x=1737150243; bh=S0tOzoXLwisGy9A9CBLzeRujOrrznu2qczLbErZjF5w=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=upCwUNOs7sK38w8OUB9/Ibp5X9A/R+ohEbiBJaBMvqiVnJUUBt8bko46lD8sLWnxC miNJ9ya64IA/CUMZuCXRPpa1hNeS/2p7RCQfnFVcRJDZPueLaVzsf3c9As0EN6BcYt 2qryn6G5nHWQ6uv/OrStwaR6o+CO4bUd+PmZ5FvRUVlh5FvQDsev3lvBcX3CsEdkrn RJtVEH7fFvfaGus1QXyqNwE4TNVftkV2z5tBOqW3hBxXxDzmYGZCcSlbx7rOfmMAfQ kXCAn3HODcIwasNIMg8WuTLsWxr3XBOe4HHwGCMmzKBVFY/uGLFMhQ7GTembSdpHAP gTHy3bqMVLAPw== Date: Tue, 14 Jan 2025 21:43:59 +0000 To: Paul Eggert <eggert@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87bjw9oyuk.fsf@HIDDEN> In-Reply-To: <9206fb42-d62e-4904-897e-ae7407680af9@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <875xmm1lzb.fsf@HIDDEN> <df2d589b-84b0-4177-930d-8feb29e9d4bb@HIDDEN> <878qrdqv2s.fsf@HIDDEN> <9206fb42-d62e-4904-897e-ae7407680af9@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 872066525b603a030fcae185ce8d7b88e0b2478c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Paul Eggert" <eggert@HIDDEN> writes: > On 2025-01-14 07:22, Pip Cet wrote: >> The GCC options are rather strange: > > Yes, it seems there are so many differing opinions about enums that it's > hard to (ahem) enumerate them all. Indeed, but I agree with Gerd that exhaustive switches are the thing to do, when at all possible. >> What we want, I think, is to prohibit a switch which contains a "case >> ENUM_VALUE:" label (where ENUM_VALUE is, well, any enum's value) from >> being either non-exhaustive across the enum or containing a default >> label as well. > > I wouldn't want to prohibit all such switches. I can think of lots of > reasons to allow them, e.g., "enum { NAME =3D EXPR };" is a common way to > name an integer constant expression. You're right. I think it would be okay to add two exceptions: 1. If an enum contains a single value, it's not "switchable", so we don't warn about it. 2. If an enum's values don't form a contiguous range, it's not "switchable" either. Together with the very useful exception already present in gcc (if we switch on a value which is an integer constant, we don't warn about the switch statement being non-exhaustive), I think that would work. Kind of does, with the patch below, but it obviously needs some more work :-) svg_css_length_to_pixels doesn't handle RSVG_UNIT_CH; draw_fringe_bitmap doesn't handle DEFAULT_CURSOR; treesit_query_error_to_string doesn't handle TSQueryErrorLanguage. The rest seem like false positives, at first glance. Of course, if it encourages people to use "if" instead of "switch", that would usually defeat the purpose. Pip diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index 81ca5d34df8..00b192a05da 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -5166,7 +5166,7 @@ case_compare (splay_tree_key k1, splay_tree_key k2) =20 tree c_add_case_label (location_t loc, splay_tree cases, tree cond, -=09=09 tree low_value, tree high_value, tree attrs) +=09=09 tree low_value, tree high_value, tree original_low_value, tree ori= ginal_high_value, tree attrs) { tree type; tree label; @@ -5333,7 +5333,7 @@ c_add_case_label (location_t loc, splay_tree cases, t= ree cond, } =20 /* Add a CASE_LABEL to the statement-tree. */ - case_label =3D add_stmt (build_case_label (low_value, high_value, label)= ); + case_label =3D add_stmt (build_case_label (low_value, high_value, origin= al_low_value, original_high_value, label)); /* Register this case label in the splay tree. */ splay_tree_insert (cases, =09=09 (splay_tree_key) low_value, diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index efd942c482b..1700784beaf 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -1067,6 +1067,7 @@ extern void c_init_preprocess (void); #define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_5 (NODE)) =20 extern tree do_case (location_t, tree, tree, tree); +extern tree do_case (location_t, tree, tree, tree, tree); extern tree build_stmt (location_t, enum tree_code, ...); extern tree build_real_imag_expr (location_t, enum tree_code, tree); =20 @@ -1095,6 +1096,7 @@ extern tree boolean_increment (enum tree_code, tree); extern int case_compare (splay_tree_key, splay_tree_key); =20 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, +=09=09=09 tree, tree, =09=09=09 tree =3D NULL_TREE); extern bool c_switch_covers_all_cases_p (splay_tree, tree); extern bool c_block_may_fallthru (const_tree); diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc index d547b08f55d..94cbe203428 100644 --- a/gcc/c-family/c-warn.cc +++ b/gcc/c-family/c-warn.cc @@ -1578,6 +1578,57 @@ match_case_to_enum (splay_tree_node node, void *data= ) =20 /* Handle -Wswitch*. Called from the front end after parsing the switch construct. */ + +static bool +c_switchable_enum (tree type) +{ + if (type =3D=3D NULL_TREE) + return false; + + if (TREE_CODE (type) !=3D ENUMERAL_TYPE) + return false; + + tree min_value =3D NULL_TREE; + tree max_value =3D NULL_TREE; + size_t n_values =3D 0; + for (tree chain =3D TYPE_VALUES (type); chain; chain =3D TREE_CHAIN (cha= in)) + { + tree value =3D TREE_VALUE (chain); + tree attrs =3D DECL_ATTRIBUTES (value); + value =3D DECL_INITIAL (value); + if (!min_value || tree_int_cst_compare (value, min_value) < 0) +=09min_value =3D value; + if (!max_value || tree_int_cst_compare (value, max_value) > 0) +=09max_value =3D value; + n_values++; + } + + /* single-value enum */ + if (n_values < 2 || tree_int_cst_compare (min_value, max_value) =3D=3D 0= ) + return false; + + while (tree_int_cst_compare (min_value, max_value) <=3D 0) + { + bool okay =3D false; + for (tree chain =3D TYPE_VALUES (type); chain; chain =3D TREE_CHAIN = (chain)) +=09{ +=09 tree value =3D TREE_VALUE (chain); +=09 value =3D DECL_INITIAL (value); +=09 if (tree_int_cst_compare (value, min_value) =3D=3D 0) +=09 { +=09 okay =3D true; +=09 break; +=09 } +=09} + if (!okay) +=09return false; + + min_value =3D build_int_cst (TREE_TYPE (min_value), tree_to_shwi (mi= n_value) + 1); + } + + return true; +} + /* ??? Should probably be somewhere generic, since other languages besides C and C++ would want this. At the moment, however, C/C++ are the only tree-ssa languages that support enumerations at all, @@ -1591,7 +1642,62 @@ c_do_switch_warnings (splay_tree cases, location_t s= witch_location, splay_tree_node node; tree chain; bool outside_range_p =3D false; + tree enum_type =3D NULL; + tree int_type =3D NULL; + bool inferred_type =3D false; + tree last_high_value =3D NULL_TREE; + for (splay_tree_node node =3D splay_tree_successor (cases, (splay_tree_k= ey) NULL); + ; + node =3D splay_tree_successor (cases, (splay_tree_key) CASE_LOW ((t= ree)node->value))) + { + if (!node) +=09break; + if (node->key) +=09{ +=09 if (CASE_ORIGINAL_LOW ((tree) node->value)) +=09 { +=09 tree case_type =3D CASE_ORIGINAL_LOW ((tree) node->value); +=09 again: +=09 if (TREE_CODE (case_type) =3D=3D ENUMERAL_TYPE) +=09=09{ +=09=09 if (enum_type && enum_type !=3D case_type) +=09=09 { +=09=09 location_t loc =3D EXPR_LOCATION ((tree) node->value); +=09=09 warning_at (loc, +=09=09=09=09 OPT_Wswitch_enum, +=09=09=09=09 "two different enums used in the same switch"); +=09=09 } +=09=09 if (int_type) +=09=09 { +=09=09 location_t loc =3D EXPR_LOCATION ((tree) node->value); +=09=09 warning_at (loc, +=09=09=09=09 OPT_Wswitch_enum, +=09=09=09=09 "enums and integer values used in the same switch"); +=09=09 } +=09=09 enum_type =3D case_type; +=09=09} +=09 else if (INTEGRAL_TYPE_P (case_type)) +=09=09{ +=09=09 if (enum_type) +=09=09 { +=09=09 location_t loc =3D EXPR_LOCATION ((tree) node->value); +=09=09 warning_at (loc, +=09=09=09=09 OPT_Wswitch_enum, +=09=09=09=09 "enums and integer values used in the same switch"); +=09=09 } =20 +=09=09 int_type =3D case_type; +=09=09} +=09 else +=09=09{ +=09=09 case_type =3D TREE_TYPE (case_type); +=09=09 goto again; +=09=09} +=09 } +=09} + if (!(splay_tree_key) CASE_LOW ((tree) node->value)) +=09break; + } if (type !=3D error_mark_node && type !=3D TREE_TYPE (cond) && INTEGRAL_TYPE_P (type) @@ -1723,6 +1829,24 @@ c_do_switch_warnings (splay_tree cases, location_t s= witch_location, =09=09 "switch condition has boolean value"); } =20 + if (TREE_CODE (type) !=3D ENUMERAL_TYPE) + { + if (!enum_type) +=09return; + + type =3D enum_type; + inferred_type =3D true; + } + else + { + if (enum_type && enum_type !=3D type) +=09{ +=09 location_t loc =3D EXPR_LOCATION (cond); +=09 warning_at (loc, +=09=09 OPT_Wswitch_enum, +=09=09 "enum type mismatch"); +=09} + } /* From here on, we only care about enumerated types. */ if (!type || TREE_CODE (type) !=3D ENUMERAL_TYPE) return; @@ -1746,8 +1870,15 @@ c_do_switch_warnings (splay_tree cases, location_t s= witch_location, O(N), since the nature of the splay tree will keep the next element adjacent to the root at all times. */ =20 + bool warned =3D false; for (chain =3D TYPE_VALUES (type); chain; chain =3D TREE_CHAIN (chain)) { + if (default_node && !warned) +=09{ +=09 warning_at (switch_location, OPT_Wswitch_default, +=09=09 !inferred_type ? "enumerated switch has a default case" : "enu= merated switch has a default case (inferred)"); +=09 warned =3D true; +=09} tree value =3D TREE_VALUE (chain); tree attrs =3D DECL_ATTRIBUTES (value); value =3D DECL_INITIAL (value); @@ -1805,12 +1936,11 @@ c_do_switch_warnings (splay_tree cases, location_t = switch_location, =09 Wswitch-enum. Otherwise, if both are enabled then we prefer =09 to warn using -Wswitch because -Wswitch is enabled by -Wall =09 while -Wswitch-enum is explicit. */ - warning_at (switch_location, -=09=09 (default_node || !warn_switch -=09=09 ? OPT_Wswitch_enum -=09=09 : OPT_Wswitch), -=09=09 "enumeration value %qE not handled in switch", -=09=09 TREE_PURPOSE (chain)); + if (c_switchable_enum (type)) +=09warning_at (switch_location, +=09=09 OPT_Wswitch, +=09=09 !inferred_type ? "enumeration value %qE not handled in switch" := "enumeration value %qE not handled in switch (inferred type)", +=09=09 TREE_PURPOSE (chain)); } =20 /* Attribute flag_enum means bitwise combinations are OK. */ diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index d2f45912cc4..eafc247f37a 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -7816,15 +7816,21 @@ c_parser_label (c_parser *parser, tree std_attrs) =20 if (c_parser_next_token_is_keyword (parser, RID_CASE)) { + struct c_expr expr; tree exp1, exp2; + tree exp1o, exp2o; c_parser_consume_token (parser); + expr =3D c_parser_expr_no_commas (parser, NULL), exp1 =3D convert_lvalue_to_rvalue (loc1, -=09=09=09=09 c_parser_expr_no_commas (parser, NULL), +=09=09=09=09 expr, =09=09=09=09 true, true).value; + exp1o =3D convert_lvalue_to_rvalue (loc1, +=09=09=09=09=09expr, +=09=09=09=09=09true, true, true).value; if (c_parser_next_token_is (parser, CPP_COLON)) =09{ =09 c_parser_consume_token (parser); -=09 label =3D do_case (loc1, exp1, NULL_TREE, std_attrs); +=09 label =3D do_case (loc1, exp1o, expr.original_type ? expr.original_ty= pe : TREE_TYPE (exp1o), NULL_TREE, std_attrs); =09} else if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) =09{ @@ -7834,7 +7840,7 @@ c_parser_label (c_parser *parser, tree std_attrs) =09=09=09=09=09=09=09=09 NULL), =09=09=09=09=09 true, true).value; =09 if (c_parser_require (parser, CPP_COLON, "expected %<:%>")) -=09 label =3D do_case (loc1, exp1, exp2, std_attrs); +=09 label =3D do_case (loc1, exp1o, expr.original_type ? expr.original_= type : TREE_TYPE (exp1o), exp2, std_attrs); =09} else =09c_parser_error (parser, "expected %<:%> or %<...%>"); @@ -7843,7 +7849,7 @@ c_parser_label (c_parser *parser, tree std_attrs) { c_parser_consume_token (parser); if (c_parser_require (parser, CPP_COLON, "expected %<:%>")) -=09label =3D do_case (loc1, NULL_TREE, NULL_TREE, std_attrs); +=09label =3D do_case (loc1, NULL_TREE, NULL_TREE, NULL_TREE, std_attrs); } else { diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index 6e40f7edf02..75e92e6f48e 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -12777,7 +12777,53 @@ tree do_case (location_t loc, tree low_value, tree high_value, tree attrs) { tree label =3D NULL_TREE; + tree original_low_value =3D low_value; + tree original_high_value =3D high_value; + if (low_value && TREE_CODE (low_value) !=3D INTEGER_CST) + { + low_value =3D c_fully_fold (low_value, false, NULL); + if (TREE_CODE (low_value) =3D=3D INTEGER_CST) +=09pedwarn (loc, OPT_Wpedantic, +=09=09 "case label is not an integer constant expression"); + } + + if (high_value && TREE_CODE (high_value) !=3D INTEGER_CST) + { + high_value =3D c_fully_fold (high_value, false, NULL); + if (TREE_CODE (high_value) =3D=3D INTEGER_CST) +=09pedwarn (input_location, OPT_Wpedantic, +=09=09 "case label is not an integer constant expression"); + } =20 + if (c_switch_stack =3D=3D NULL) + { + if (low_value) +=09error_at (loc, "case label not within a switch statement"); + else +=09error_at (loc, "%<default%> label not within a switch statement"); + return NULL_TREE; + } + + if (c_check_switch_jump_warnings (c_switch_stack->bindings, +=09=09=09=09 EXPR_LOCATION (c_switch_stack->switch_stmt), +=09=09=09=09 loc)) + return NULL_TREE; + + label =3D c_add_case_label (loc, c_switch_stack->cases, +=09=09=09 SWITCH_STMT_COND (c_switch_stack->switch_stmt), +=09=09=09 low_value, high_value, +=09=09=09 original_low_value, original_high_value, attrs); + if (label =3D=3D error_mark_node) + label =3D NULL_TREE; + return label; +} + +tree +do_case (location_t loc, tree low_value, tree low_original_type, tree high= _value, tree attrs) +{ + tree label =3D NULL_TREE; + tree original_low_value =3D low_value; + tree original_high_value =3D high_value; if (low_value && TREE_CODE (low_value) !=3D INTEGER_CST) { low_value =3D c_fully_fold (low_value, false, NULL); @@ -12810,7 +12856,8 @@ do_case (location_t loc, tree low_value, tree high_= value, tree attrs) =20 label =3D c_add_case_label (loc, c_switch_stack->cases, =09=09=09 SWITCH_STMT_COND (c_switch_stack->switch_stmt), -=09=09=09 low_value, high_value, attrs); +=09=09=09 low_value, high_value, +=09=09=09 low_original_type, original_high_value, attrs); if (label =3D=3D error_mark_node) label =3D NULL_TREE; return label; diff --git a/gcc/tree.cc b/gcc/tree.cc index eab40008e8b..4ef82052971 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -2795,6 +2795,26 @@ build_case_label (tree low_value, tree high_value, t= ree label_decl) =20 CASE_LOW (t) =3D low_value; CASE_HIGH (t) =3D high_value; + CASE_ORIGINAL_LOW (t) =3D NULL_TREE; + CASE_ORIGINAL_HIGH (t) =3D NULL_TREE; + CASE_LABEL (t) =3D label_decl; + CASE_CHAIN (t) =3D NULL_TREE; + + return t; +} + +tree +build_case_label (tree low_value, tree high_value, tree original_low_value= , tree original_high_value, tree label_decl) +{ + tree t =3D make_node (CASE_LABEL_EXPR); + + TREE_TYPE (t) =3D void_type_node; + SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (label_decl)); + + CASE_LOW (t) =3D low_value; + CASE_HIGH (t) =3D high_value; + CASE_ORIGINAL_LOW (t) =3D original_low_value; + CASE_ORIGINAL_HIGH (t) =3D original_high_value; CASE_LABEL (t) =3D label_decl; CASE_CHAIN (t) =3D NULL_TREE; =20 diff --git a/gcc/tree.def b/gcc/tree.def index 44871367d0d..b6213d1fa39 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -1006,7 +1006,7 @@ DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statemen= t, 2) Operand 3 is CASE_CHAIN. This operand is only used in tree-cfg.cc to speed up the lookup of case labels which use a particular edge in the control flow graph. */ -DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4) +DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 6) =20 /* Used to represent an inline assembly statement. ASM_STRING returns a STRING_CST for the instruction (e.g., "mov x, y"). ASM_OUTPUTS, diff --git a/gcc/tree.h b/gcc/tree.h index aaaf703186c..c7a51036a8e 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1407,6 +1407,8 @@ class auto_suppress_location_wrappers #define CASE_HIGH(NODE) =09TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NO= DE), 1) #define CASE_LABEL(NODE)=09=09TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), = 2) #define CASE_CHAIN(NODE)=09=09TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), = 3) +#define CASE_ORIGINAL_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHEC= K (NODE), 4) +#define CASE_ORIGINAL_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHEC= K (NODE), 5) =20 /* The operands of a TARGET_MEM_REF. Operands 0 and 1 have to match corresponding MEM_REF operands. */ @@ -4743,6 +4745,8 @@ extern tree copy_list (tree); =20 extern tree build_case_label (tree, tree, tree); =20 +extern tree build_case_label (tree, tree, tree, tree, tree); + /* Make a BINFO. */ extern tree make_tree_binfo (unsigned CXX_MEM_STAT_INFO); =20
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 14 Jan 2025 19:24:38 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 14 14:24:38 2025 Received: from localhost ([127.0.0.1]:55763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tXmWj-0001wC-UX for submit <at> debbugs.gnu.org; Tue, 14 Jan 2025 14:24:38 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:51988) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1tXmWh-0001vw-RK for 75451 <at> debbugs.gnu.org; Tue, 14 Jan 2025 14:24:36 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 393EF3C03E9E1; Tue, 14 Jan 2025 11:24:30 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id 7sbgmIi6uEX0; Tue, 14 Jan 2025 11:24:30 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id E06CE3C0275C4; Tue, 14 Jan 2025 11:24:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu E06CE3C0275C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736882669; bh=Jn+0TBYX3cszp3cloGFKYbT3Jh7yCSysGD5TDKjBNxQ=; h=Message-ID:Date:MIME-Version:To:From; b=l6NOZatP4Gvvk9ymX2k5FNr0hBgmzMvvbzN3GGpnXnyKbL1FRzeX85Zf1sSzTSJ5H ZJxo49klUsr7BuVZJ8aPcITvIZuCn68kVLaP6OcfSY68PIiZTdSWlkz88btpIe9A/U racKQDlvr6BkllMkGZorErWUHaymwOV3GTRag6STph+66yeOCBjxQVwsmcZItTMGey GwuOHeuD7AKSCoJaPKxj0am1s80DtnsI4FNVKXYQbCiYfG9JTLm0pXcDjE2pUbGIwR D0HUY/OnK5Zltc9bFthihWLbrPvs8x0LG0SuDTvcATeX/XznvHgeeXEEef5Odn3wBR D1RrudQWpAtzw== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id mZ5S3Q2Fh51F; Tue, 14 Jan 2025 11:24:29 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id C294B3C00FAB3; Tue, 14 Jan 2025 11:24:29 -0800 (PST) Message-ID: <9206fb42-d62e-4904-897e-ae7407680af9@HIDDEN> Date: Tue, 14 Jan 2025 11:24:29 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <875xmm1lzb.fsf@HIDDEN> <df2d589b-84b0-4177-930d-8feb29e9d4bb@HIDDEN> <878qrdqv2s.fsf@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <878qrdqv2s.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-01-14 07:22, Pip Cet wrote: > The GCC options are rather strange: Yes, it seems there are so many differing opinions about enums that it's hard to (ahem) enumerate them all. > What we want, I think, is to prohibit a switch which contains a "case > ENUM_VALUE:" label (where ENUM_VALUE is, well, any enum's value) from > being either non-exhaustive across the enum or containing a default > label as well. I wouldn't want to prohibit all such switches. I can think of lots of reasons to allow them, e.g., "enum { NAME = EXPR };" is a common way to name an integer constant expression.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 14 Jan 2025 15:22:50 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 14 10:22:50 2025 Received: from localhost ([127.0.0.1]:55353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tXikj-00066i-Nk for submit <at> debbugs.gnu.org; Tue, 14 Jan 2025 10:22:50 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:63889) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tXikg-00066Q-95 for 75451 <at> debbugs.gnu.org; Tue, 14 Jan 2025 10:22:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736868159; x=1737127359; bh=jsLiCCQ6EWPEbTWOhlFj/IPJDapvmKiX++xy3PktWPM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=DFmlhOFTgv388h4J2FexN0h5cFi1q+okHHU1fTumerHdxNnG6cu1qPi4Z4lXOowcx a3oX0LCuJcepqjOSHiK1b5nP9GIYzro/IsaIhAOu6QTdD0ZAiMfmjPSj04ZuEq/Hg3 jlANNo9WxQMLt2Wl1GzIqQG1fix3cYszFAHgFpc9+3hX0QgL+6POuVJbG/ZJ2w/0c4 zc4vMuvm8jGP6gW/dz8w9xQaZ9BDv6vwvqN3wkESyxATEkDvBBUYizPaaYsWtSEV8U YMhjzwLiSysRo1N0tU5VKstl8iUGs5e6z1ebBIPuHtoa4FgjUQHKOXiVNBFANkXN3h QcfscLxHVoDGA== Date: Tue, 14 Jan 2025 15:22:32 +0000 To: Paul Eggert <eggert@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <878qrdqv2s.fsf@HIDDEN> In-Reply-To: <df2d589b-84b0-4177-930d-8feb29e9d4bb@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <875xmm1lzb.fsf@HIDDEN> <df2d589b-84b0-4177-930d-8feb29e9d4bb@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 634373a985d53e6e305d47c94de91f439e5210f2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Paul Eggert" <eggert@HIDDEN> writes: > On 2025-01-10 11:56, Pip Cet wrote: >> Doesn't GCC have an option to turn non-exhaustive enum switches into an >> error? > > Yes, GCC has several such options. Emacs builds with > --enable-gcc-warnings use -Wall, which enables -Wswitch, which I think > does what you're asking for. The GCC options are rather strange: one of them is to warn about all switches that do NOT contain a "default" label, which is the opposite of what we want! What we want, I think, is to prohibit a switch which contains a "case ENUM_VALUE:" label (where ENUM_VALUE is, well, any enum's value) from being either non-exhaustive across the enum or containing a default label as well. So I guess we need to hack GCC to add this useful combination? Note that this fails for enums that end with a "fake" entry indicating the number of cases, such as FONT_OBJECT_MAX (this value is also misnamed, as it isn't the maximum index but the first index which isn't used). My understanding is that that practice is deprecated anyway, because someone might want to use the enum as a bit field and including an extra value may waste a bit. Here's the easy part (GCC patch; build with --disable-werror because the new warnings break the build): diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc index d547b08f55d..f1ce18ad851 100644 --- a/gcc/c-family/c-warn.cc +++ b/gcc/c-family/c-warn.cc @@ -1673,9 +1673,9 @@ c_do_switch_warnings (splay_tree cases, location_t sw= itch_location, return; =20 default_node =3D splay_tree_lookup (cases, (splay_tree_key) NULL); - if (!default_node) + if (default_node) warning_at (switch_location, OPT_Wswitch_default, -=09=09"switch missing default case"); +=09=09"switch has a default case!"); =20 /* There are certain cases where -Wswitch-bool warnings aren't desirable, such as @@ -1746,8 +1746,15 @@ c_do_switch_warnings (splay_tree cases, location_t s= witch_location, O(N), since the nature of the splay tree will keep the next element adjacent to the root at all times. */ =20 + bool warned =3D false; for (chain =3D TYPE_VALUES (type); chain; chain =3D TREE_CHAIN (chain)) { + if (default_node && !warned) +=09{ +=09 warning_at (switch_location, OPT_Wswitch_default, +=09=09 "enumerated switch has a default case!"); +=09 warned =3D true; +=09} tree value =3D TREE_VALUE (chain); tree attrs =3D DECL_ATTRIBUTES (value); value =3D DECL_INITIAL (value); @@ -1806,9 +1813,7 @@ c_do_switch_warnings (splay_tree cases, location_t sw= itch_location, =09 to warn using -Wswitch because -Wswitch is enabled by -Wall =09 while -Wswitch-enum is explicit. */ warning_at (switch_location, -=09=09 (default_node || !warn_switch -=09=09 ? OPT_Wswitch_enum -=09=09 : OPT_Wswitch), +=09=09 OPT_Wswitch, =09=09 "enumeration value %qE not handled in switch", =09=09 TREE_PURPOSE (chain)); } The hard part is extending this warning to switch ((int)enum_value) { ... } IIRC, it's quite common to effectively do that because your enum value is stored in a bitfield, for example. Possibly not a problem for Emacs C code in src/, which is supposed to use ENUM_BF, IIUC. (The patch doesn't handle empty enums, but GCC throws an error for those, as it should :-) ) 198 warnings to check, I guess... Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 10 Jan 2025 23:14:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 10 18:14:18 2025 Received: from localhost ([127.0.0.1]:40136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tWOCn-0005pl-W0 for submit <at> debbugs.gnu.org; Fri, 10 Jan 2025 18:14:18 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:54218) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1tWOCl-0005pQ-73 for 75451 <at> debbugs.gnu.org; Fri, 10 Jan 2025 18:14:15 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 795683C12386F; Fri, 10 Jan 2025 15:14:09 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id OzY1c7RKxZ9C; Fri, 10 Jan 2025 15:14:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 3E0603C12386E; Fri, 10 Jan 2025 15:14:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 3E0603C12386E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736550849; bh=jAlX561s39u7G+M6cQHZJBnJEee79SpK/XjZpp+3y1s=; h=Message-ID:Date:MIME-Version:To:From; b=Qjgk4qcfvAUl3THkbCSnOhbzR1zbMOslx++wacfZ67NXDKZn++qKRUI89Go5Xr4nJ zVhixlOdxOILCNXxihwfU48jRJr2FDa36bvcs6LXeZjkRoC/JAixRgU9Ki6vrU77J9 2fzrRXBNM/etBN5yLf3a0MECOVbOo/R6L0PIbm9zGo4l0e5gy9wU4KVUoXi7MRWlgN kWaPi0XfII2EAAB47s0HV3NXa5odL1hbncVtwQtmwnFOePdv2ofnzeoBmgFrOjG3YD MNwYh3fsFe7D6eg2OSv9DaNnQvPLkpLdK09VnMSG0f6k1gfNHbQAmGubA9UNtMv0pD 9c1jGZbCwPuwA== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id kmsntDhM9TZX; Fri, 10 Jan 2025 15:14:09 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 16FBF3C12386D; Fri, 10 Jan 2025 15:14:09 -0800 (PST) Message-ID: <df2d589b-84b0-4177-930d-8feb29e9d4bb@HIDDEN> Date: Fri, 10 Jan 2025 15:14:08 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <875xmm1lzb.fsf@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <875xmm1lzb.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-01-10 11:56, Pip Cet wrote: > Doesn't GCC have an option to turn non-exhaustive enum switches into an > error? Yes, GCC has several such options. Emacs builds with --enable-gcc-warnings use -Wall, which enables -Wswitch, which I think does what you're asking for.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 10 Jan 2025 19:56:59 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 10 14:56:59 2025 Received: from localhost ([127.0.0.1]:58894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tWL7q-0005HW-Gk for submit <at> debbugs.gnu.org; Fri, 10 Jan 2025 14:56:59 -0500 Received: from mail-10631.protonmail.ch ([79.135.106.31]:20883) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tWL7n-0005HC-Lx for 75451 <at> debbugs.gnu.org; Fri, 10 Jan 2025 14:56:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736539008; x=1736798208; bh=Rt+xj0wNqU4rJn5rPKG0Pko9qw6YW2cc1ZxFnvxqr80=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=EYGXLw74EcAs/2JboUS6ECN5kj+98SxkHF7qfIt0PjxzT8igzJN5JIuRdo8BoOdCB AOXv03cG4XoGjIzYWvj11IqK3RpGvotV/sYchg6IjMSwFyWmdhwvvScPWkc1QPPzy/ E4Jr1UzVKL+pFTFhEfa6sy8vG+bEBMHXQZ/ob4m0oKbSRSpfAnyGOcJLTgtX2XuHmK FeXhui+Idih3OvRsJOj0OC057hRr5uIyF/1nP9FfayWvg734aFgAmIU2bZbIyMxz0/ 0sel2G6wcF7X+Maza57hiBQH9IyC1nLnJkXe17lnO/PhZrPYmOXwJwdCCBaPCYP/GG bYieZx1liAbIQ== Date: Fri, 10 Jan 2025 19:56:46 +0000 To: Stefan Kangas <stefankangas@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <875xmm1lzb.fsf@HIDDEN> In-Reply-To: <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 8367107b67a81d80dfeb8998ecc247d8d9bcfbac MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) "Stefan Kangas" <stefankangas@HIDDEN> writes: > Pip Cet <pipcet@HIDDEN> writes: > >> This isn't strictly about the scratch/igc branch, but I personally think >> struct hashes should be checked in all builds, mismatches should be >> downgraded to #warnings, and --enable-checking=3Dall could include >> -Werror=3Dcpp. (So the warnings would still abort a build with >> --enable-checking=3Dall, but they'd *also* show up in regular builds.) > > As I was continuing to work on CHECK_STRUCTS, I stumbled into this and > re-read parts of the old discussion linked below: > > commit 9994bf17cf532f2e1d4310341da7180342202191 > Author: Paul Eggert <eggert@HIDDEN> > Date: Wed Apr 10 19:42:37 2019 -0700 > > Bring back dmpstruct.h > > Bring back the dmpstruct.h checking, and use it when > --enable-checking=3Dstructs is specified. The checking can be helpfu= l > to some developers, although it gets in the way of others and is > not needed for ordinary tarball builds. > * src/dmpstruct.awk: Restore this file, with mode 644 not 755. > * configure.ac: New option-arg --enable-checking=3Dstructs, > implied by --enable-checking. > (CHECK_STRUCTS): New macro and var. > * src/Makefile.in (CHECK_STRUCTS): New macro. > (dmpstruct_headers, dmpstruct.h, dmpstruct.h): > Restore these macros and rules. > (pdumper.o): Restore this dependency if $(CHECK_STRUCTS) is true. > (mostlyclean): Remove dmpstruct.h. > * src/pdumper.c [CHECK_STRUCTS]: Include dmpstruct.h, > and restore checks against hashes. > > commit 44a39e3e761c0774cd1bb9360db7f49e1d66ec06 > Author: Paul Eggert <eggert@HIDDEN> > Date: Tue Apr 9 15:42:10 2019 -0700 > > Remove dmpstruct.h > > The hassles of updating the dmpstruct.h-using code bit me again. > These updates are more trouble than they=E2=80=99re worth. See: > https://lists.gnu.org/r/emacs-devel/2019-03/msg00122.html > As I=E2=80=99m the main person who=E2=80=99s made changes in this are= a since > dmpstruct.h was introduced, I=E2=80=99m the most motivated to clean u= p > the situation. > > I'm curios to know what is the experience while developing scratch/igc: > have these checks been very helpful? I can't really say that much about scratch/igc, but I'm modifying the relevant structs a lot, on several branches. I'm quite forgetful, but I can't remember a time when the #error saved me; that's why I'd prefer a #warning (but I understand the reluctance to downgrade errors into warnings, thus my proposal of using -Werror=3Dcpp). And I did check code into scratch/igc which broke the --enable-checking build. A warning would most likely have prevented that. So this is another weird case of "let's extend this, then remove the original usage": IIUC, the reason for having pdumper include the errors is that it was expected people would forget to adjust pdumper.c and test only the unexec version. Once unexec is removed, we can simply remove the errors in pdumper.c. scratch/igc is in a similar situation as pdumper was when it was merged: it'll be optional for a long time, so we need to take extra care to ensure that no one modifies the core structures but forgets to update igc.c (For example, right now both igc.c and alloc.c fail to scan the "command_modes" member of struct Lisp_Subr when we're compiling without native compilation: if someone were to use that field for a non-fixnum Lisp object, that someone would run into weird bugs and crashes and eventually figure out they need to fix alloc.c, but probably not igc.c, so we'd need to know about such changes. The hashing wouldn't necessarily save us, but it might, because they'd probably reorder the Lisp_Subr fields at the same time :-) ). I can't really say whether it would make more sense for nativecomp to simply create .eln files that are specific to one compiled Emacs rather than trying to reuse old files if the ABI hash matches, but either that or including the header hash would have saved me some trouble. > Meanwhile, for enums, I'm wondering if something like this wouldn't make > more sense? (Or perhaps in addition to CHECK_STRUCTS. Hmm.) > diff --git a/src/igc.c b/src/igc.c > index 37929765522..6c8ad55878c 100644 > --- a/src/igc.c > +++ b/src/igc.c > @@ -2770,6 +2776,8 @@ fix_vector (mps_ss_t ss, struct Lisp_Vector *v) > #endif > =09IGC_FIX_CALL_FN (ss, struct Lisp_Vector, v, fix_vectorlike); > =09break; > + default: > +=09emacs_abort (); > } > } > MPS_SCAN_END (ss); Doesn't GCC have an option to turn non-exhaustive enum switches into an error? I concur with https://www.jwz.org/doc/java.html: that life-saving warning, ``enumeration value `x' not handled in switch'' It might be best to build Emacs with -Ddefault=3Dnodefault. Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 10 Jan 2025 19:33:52 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 10 14:33:52 2025 Received: from localhost ([127.0.0.1]:58850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tWKlT-00042I-KR for submit <at> debbugs.gnu.org; Fri, 10 Jan 2025 14:33:51 -0500 Received: from mail.cs.ucla.edu ([131.179.128.66]:33964) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1tWKlS-000423-7N for 75451 <at> debbugs.gnu.org; Fri, 10 Jan 2025 14:33:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 7DA253C0344DE; Fri, 10 Jan 2025 11:33:44 -0800 (PST) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id RvuHB_gruJtY; Fri, 10 Jan 2025 11:33:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 311063C12386D; Fri, 10 Jan 2025 11:33:44 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 311063C12386D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1736537624; bh=JVNZVqYsCHxIbkl9QQu6MBJm3QObLTdXUkUrKNDrrqg=; h=Message-ID:Date:MIME-Version:To:From; b=mZcgQodbKlDCuZGPoydrxxbQkM/q4svU1OMRxn2Y3Tge8wt7qq0Nl8wiEtkWOWrxe c/NJ3xaKi8lchaaawZMcccawCclmw2IFwZIoO8H79gNUVs2bG7teR/fKIOEeb0aKCd Qu/zdavZVGLMd3gLOz1le0Cp+xSBU7MiyOVs0udBN8aO8PMHd4uo/+BeA5LpB/poo2 k9B/U/ExnGtar8xcqN09bgFWHViAtTzpNTcV5WyR9Jwp3zl5eOfF/9tSJBTFplnBVL MOK1isi09UwmPJpE//PRX/5vZZyNiuJAS7VMbP7+ZIwf3RUI7vDrqsRhudFTz5IqYv w40C8nmIa8EBQ== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id Mv2DsZyJKNEb; Fri, 10 Jan 2025 11:33:44 -0800 (PST) Received: from [192.168.254.12] (unknown [47.154.28.214]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 10D3C3C0344DE; Fri, 10 Jan 2025 11:33:44 -0800 (PST) Message-ID: <16e72c75-39f6-446a-9603-b694f4fd1750@HIDDEN> Date: Fri, 10 Jan 2025 11:33:43 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> <m234hqwl6m.fsf@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <m234hqwl6m.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Pip Cet <pipcet@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-01-10 10:58, Gerd M=C3=B6llmann wrote: > Stefan Kangas <stefankangas@HIDDEN> writes: >> I'm curios to know what is the experience while developing scratch/igc= : >> have these checks been very helpful? >=20 > It was helpful for me, in the pdumper, because I hadn't activated it in > igc.c. Reason for it being that I have some other differences in my for= k, > like CL packages :-). I haven't been developing in scratch/igc and so can't say anything there. As I recall, CHECK_STRUCTS was introduced for pdumper and got in the way=20 of everything else I developed, where it generated nothing but false alar= ms. > I'm personally a big fan of exhaustive switches, as igc.c might show > :-). I find they make it a lot easier to find all relevant places when > adding enums. And I think the default case would work against that. Yes, inserting 'default: emacs_abort ();' switches from static to=20 dynamic checking, which is less reliable. Although 'default: emacs_abort=20 ();' is sometimes the best one can do, it's better to avoid it when=20 possible. I use 'default: eassume (false);' more often than 'default: emacs_abort=20 ();', though for a completely different purpose: to tell GCC something=20 that it's not smart enough to figure out on its own, so that GCC can do=20 better static checking elsewhere.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 10 Jan 2025 18:58:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 10 13:58:21 2025 Received: from localhost ([127.0.0.1]:58798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tWKD6-00026l-K1 for submit <at> debbugs.gnu.org; Fri, 10 Jan 2025 13:58:20 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:49621) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tWKD4-00026U-IE for 75451 <at> debbugs.gnu.org; Fri, 10 Jan 2025 13:58:19 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso17990325e9.3 for <75451 <at> debbugs.gnu.org>; Fri, 10 Jan 2025 10:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736535492; x=1737140292; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C3qBctqqh6qiP/goqZcSU+CxR0Fq/AdjTxNoryySto0=; b=lKFlpdsShuFKjLxSKk0K1xVLOmt44J6MjfOf3wyI+R7CSkSlogFfSP+CJOFy6hLT7P NMJNcAfCrpnXQ9HMarGdzryHzJb/lWZ2ZLOn1K6xO/ouuKNp7nuW9pdN5tKJlcDU1wtD U/kDzlU4sOl45iK9DinZMc/LdzHPZcrzHM5vUwTKTIDSrUXKCNWz5m/Lgu5Bcqza2pKv ndGD11Y72sIYvOaFf92q4OjEHWUFMJ4GU3STyHSb5YX2b7+JoReypjjGygQ1bCpm5GUi lYiwdZSqyJWdHNWESdf5lVwRaEIb+Wiok36C3Ryvdh1hjL2+3xwbwuMhXxCMhaNo3aQe Jj7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736535492; x=1737140292; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C3qBctqqh6qiP/goqZcSU+CxR0Fq/AdjTxNoryySto0=; b=fauV00xLkgqFtppAqFgRTBXpNJFz8Ozl8rgAZz9Nqh003Ozzbl8RljYbFFL1SvUG4L pEu3qRhbkGKC5EG9ba/WzejB7Jw6Puc4uK8NsmeQypg8OtVQ5VtZj9Hdk784WT/zrQK7 8WaUaQvI4IgCO8G4bwlmPZZChy0SPyjttlXKDUupWqaUITwVgrus+nETRWHVGM17pQLA 3LP1gpmej5uqGVPVX4+SGBxRA1RuNLio5v1eCDU71CvmHxKd7ikzlGpj9KhWW4tZgWyU htu/wv/MIdxFcpGDQRszTd2ycKoABGWGiiUyo/sOIIMBzSqFByLc6ffC2jiNeUMA0K26 l3lA== X-Forwarded-Encrypted: i=1; AJvYcCVjWNeao/Flr1Tp0+d4/ZDAJEPc29TBeQOU9jsKMUY3zrGbMkYSNcV3aostb/egYuc2LSiopw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzFc/3FnOOVkxQrHcLZggMHOKeFXZeo+qXTRy1DMlMnptlhqbjy KQgctu+7VGkoPaxkvG5StkitWoP0yqR9QvaloILMdI8N1uoGYGGc X-Gm-Gg: ASbGncsrrczQh8xjI432Kp0IlvBqhHdRr6mdeJuHPvUvILY8cL+le8V9fswU6C08aZs UtyCXHQUUK8jYGwmUpV3dRsmGQzZEGRrFApuIzGy8XtU6buDOhXWy2dZ8XK7VSP6fmgCqalyKen aZOVY4lQEYQ61b5yUAoyde5Yp07RG4fDwAUUAgC43psfAKxLreNJ32cYsM3V9GZ3MA6Pw1engwq PLhmoEoq7+SH8GanRW5CKK0nPrkW/8xCHPN+5wY9WF1EmfrhBCjtNeum2X8mDRl6auAUYN7E9mF QBD66gLmbTP9iRZtkBBIwqvqKdz0m6xOGBCaxAYJc45Wk6+TtWswytrZbdjG/5tTqg== X-Google-Smtp-Source: AGHT+IGGoAKyO+WtcOqBY/POphCQWh/C05Gqle+C+mUIH3vPM3kIgqhpSC3ShIdLMjYxe2kSwKoW8Q== X-Received: by 2002:a05:6000:709:b0:38a:41c9:8544 with SMTP id ffacd0b85a97d-38a87336a6amr10490904f8f.37.1736535492075; Fri, 10 Jan 2025 10:58:12 -0800 (PST) Received: from pro2 (p200300e0b703ad00d49c34c25e204681.dip0.t-ipconnect.de. [2003:e0:b703:ad00:d49c:34c2:5e20:4681]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37d46sm59888765e9.25.2025.01.10.10.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 10:58:11 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> (Stefan Kangas's message of "Fri, 10 Jan 2025 18:42:56 +0000") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> Date: Fri, 10 Jan 2025 19:58:09 +0100 Message-ID: <m234hqwl6m.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Pip Cet <pipcet@HIDDEN>, Paul Eggert <eggert@HIDDEN>, Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Kangas <stefankangas@HIDDEN> writes: > commit 44a39e3e761c0774cd1bb9360db7f49e1d66ec06 > Author: Paul Eggert <eggert@HIDDEN> > Date: Tue Apr 9 15:42:10 2019 -0700 > > Remove dmpstruct.h > > The hassles of updating the dmpstruct.h-using code bit me again. > These updates are more trouble than they=E2=80=99re worth. See: > https://lists.gnu.org/r/emacs-devel/2019-03/msg00122.html > As I=E2=80=99m the main person who=E2=80=99s made changes in this are= a since > dmpstruct.h was introduced, I=E2=80=99m the most motivated to clean up > the situation. > > I'm curios to know what is the experience while developing scratch/igc: > have these checks been very helpful? It was helpful for me, in the pdumper, because I hadn't activated it in igc.c. Reason for it being that I have some other differences in my fork, like CL packages :-). > Meanwhile, for enums, I'm wondering if something like this wouldn't make > more sense? (Or perhaps in addition to CHECK_STRUCTS. Hmm.) > > diff --git a/src/igc.c b/src/igc.c > index 37929765522..6c8ad55878c 100644 > --- a/src/igc.c > +++ b/src/igc.c > @@ -2770,6 +2776,8 @@ fix_vector (mps_ss_t ss, struct Lisp_Vector *v) > #endif > IGC_FIX_CALL_FN (ss, struct Lisp_Vector, v, fix_vectorlike); > break; > + default: > + emacs_abort (); > } > } > MPS_SCAN_END (ss); I'm personally a big fan of exhaustive switches, as igc.c might show :-). I find they make it a lot easier to find all relevant places when adding enums. And I think the default case would work against that.
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451) by debbugs.gnu.org; 10 Jan 2025 18:43:06 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 10 13:43:06 2025 Received: from localhost ([127.0.0.1]:58774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tWJyM-0001JJ-3A for submit <at> debbugs.gnu.org; Fri, 10 Jan 2025 13:43:06 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:42256) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tWJyJ-0001If-JE for 75451 <at> debbugs.gnu.org; Fri, 10 Jan 2025 13:43:04 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5d3dce16a3dso4268482a12.1 for <75451 <at> debbugs.gnu.org>; Fri, 10 Jan 2025 10:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736534577; x=1737139377; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=xMBM1+pBKigZ/rQJ7yFhMiQ7ZyTv/G7m1UDflCtG6zk=; b=dJRK51JZOoCSRY/+lDZkc9LpsNVBhhTRq+AJ5e99j+Y1kjPMFFd8zZ+S+7xafN78/i J2LlSC7IHgMwr2pkHPH3P8sN1BS77MTNLZETiblRWRI71YqiHlSJSHXuSsg/DBNEDTnt UnD6jJFb+REEJldz05jB74U2VmNODfUsdfia32iC65Pf2j5NVbdFbjNu2jF4rghmx9KS q4pm8cLTlmztSKK8mNVHqCYxdJjOocC0Fz+JS0jvRc4+5kK7GKqlQlDoLzTPJvW4Gbyl zGb6AaQHRKBSrXy13sYAoQUGaHvw91EwLw1HDkEQGWB0eZTFcquAIk8G1ZuL0hdMPTSI 9srg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736534577; x=1737139377; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=xMBM1+pBKigZ/rQJ7yFhMiQ7ZyTv/G7m1UDflCtG6zk=; b=vWQbYu6LddX+Tr+YhEgiPHMOv5XfAOUQMwcUZOhu9HE7jgXRSrJwGUpAaiS3CCe1jI wa5NZhxZX2JR/VaAoaIatbKAX/oKDuWZFXRHUDkKzNsGByMmCyblM/rHZKds9xH0HPb/ QU4G3os54LO31y4tj1uSsyB4aH1muOH0OA0WFhaOcVuFmnnGZ3WgqOpp1IXMHEz9VvRs IKp7jQ9KzH89Dp9egn+28cUWqY/5fgPZknD6gPWgfarkO6EzQ51hUxJbFDLo1zgUG/4a rnuTDA+9zLjfIOsf73CB3sjiPee/iewAmLvK+g+9vMFFtlLn1b+sIm03Lj33gsIjmhsY e9iA== X-Forwarded-Encrypted: i=1; AJvYcCVPDBfpTiF5HtRp6JVy/QlGvMVz8L0++/4n7CfCyW/QRgbg2tqCfBR0ELg2sKeS5ePo9xKcrA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxoM6YcwqHFS8X0zYyg3WNINsj7MA00Qz0ZumAYuZMsr5KDaPDk 4yYHS3fI750SY6UA4lhP5OfVbf7hKcFvmQzKARfeWrl+6oWsWBSPEAstc1GP/Ot/jegfX3JVOro ZE/1c7Zlm92HjC/Wv2DBHmTaMWRQ= X-Gm-Gg: ASbGncuKcki6MBAq53obEoVf4GiWBC+rYeFBfm7ySXNZIH4FG9BIcOFUYOamw7aTa2K C/9s7L5uslAR03JC4CXzyrf0MKftc1WhjEnDJVIrJ X-Google-Smtp-Source: AGHT+IFVBTQYVMiZS/XLO4pXILBbEwX29IuTdP15eKysibbOdl68/5mhiM4r0rJjbpFs1JNA8tk4f2gN/DJ7vTekCzg= X-Received: by 2002:a05:6402:3495:b0:5d3:f617:a003 with SMTP id 4fb4d7f45d1cf-5d98619b22fmr7321994a12.4.1736534576856; Fri, 10 Jan 2025 10:42:56 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 10 Jan 2025 18:42:56 +0000 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87frls47uu.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> MIME-Version: 1.0 Date: Fri, 10 Jan 2025 18:42:56 +0000 X-Gm-Features: AbW1kvbdH6trOD9AyJbZLb8H0BI0c7GnRp0ZYPmpGtCM0JEg0FG4ECta0XWXDcM Message-ID: <CADwFkm=1z-E83XNkcL4_Oh7Z1=B-2P2Qq=GfgRksf9cv=fm7tA@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, Paul Eggert <eggert@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: > This isn't strictly about the scratch/igc branch, but I personally think > struct hashes should be checked in all builds, mismatches should be > downgraded to #warnings, and --enable-checking=3Dall could include > -Werror=3Dcpp. (So the warnings would still abort a build with > --enable-checking=3Dall, but they'd *also* show up in regular builds.) As I was continuing to work on CHECK_STRUCTS, I stumbled into this and re-read parts of the old discussion linked below: commit 9994bf17cf532f2e1d4310341da7180342202191 Author: Paul Eggert <eggert@HIDDEN> Date: Wed Apr 10 19:42:37 2019 -0700 Bring back dmpstruct.h Bring back the dmpstruct.h checking, and use it when --enable-checking=3Dstructs is specified. The checking can be helpful to some developers, although it gets in the way of others and is not needed for ordinary tarball builds. * src/dmpstruct.awk: Restore this file, with mode 644 not 755. * configure.ac: New option-arg --enable-checking=3Dstructs, implied by --enable-checking. (CHECK_STRUCTS): New macro and var. * src/Makefile.in (CHECK_STRUCTS): New macro. (dmpstruct_headers, dmpstruct.h, dmpstruct.h): Restore these macros and rules. (pdumper.o): Restore this dependency if $(CHECK_STRUCTS) is true. (mostlyclean): Remove dmpstruct.h. * src/pdumper.c [CHECK_STRUCTS]: Include dmpstruct.h, and restore checks against hashes. commit 44a39e3e761c0774cd1bb9360db7f49e1d66ec06 Author: Paul Eggert <eggert@HIDDEN> Date: Tue Apr 9 15:42:10 2019 -0700 Remove dmpstruct.h The hassles of updating the dmpstruct.h-using code bit me again. These updates are more trouble than they=E2=80=99re worth. See: https://lists.gnu.org/r/emacs-devel/2019-03/msg00122.html As I=E2=80=99m the main person who=E2=80=99s made changes in this area = since dmpstruct.h was introduced, I=E2=80=99m the most motivated to clean up the situation. I'm curios to know what is the experience while developing scratch/igc: have these checks been very helpful? Meanwhile, for enums, I'm wondering if something like this wouldn't make more sense? (Or perhaps in addition to CHECK_STRUCTS. Hmm.) diff --git a/src/igc.c b/src/igc.c index 37929765522..6c8ad55878c 100644 --- a/src/igc.c +++ b/src/igc.c @@ -2770,6 +2776,8 @@ fix_vector (mps_ss_t ss, struct Lisp_Vector *v) #endif IGC_FIX_CALL_FN (ss, struct Lisp_Vector, v, fix_vectorlike); break; + default: + emacs_abort (); } } MPS_SCAN_END (ss);
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 9 Jan 2025 12:44:56 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 09 07:44:56 2025 Received: from localhost ([127.0.0.1]:50755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVruC-0005eL-D1 for submit <at> debbugs.gnu.org; Thu, 09 Jan 2025 07:44:56 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:47255) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tVruA-0005e7-T0 for 75451-done <at> debbugs.gnu.org; Thu, 09 Jan 2025 07:44:55 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-aaeec07b705so156717266b.2 for <75451-done <at> debbugs.gnu.org>; Thu, 09 Jan 2025 04:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736426688; x=1737031488; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=/By/nNQiDNpIoWkmb6am6x6T/SKSKj43SsjP/pBJ2zo=; b=Jsyj7/DFRGKipj7aGAEoXzOvj6UFN+u3EkIdjcqYJHRdYnaByvuLtn0ffZysrsLSRZ xu07TmpFy3+lRELfllRlxdHuYlrG6k/wll8ka9QfMu63cTUAAJKKPOkv8KqBMxrANQoc inM1gGYhLEXtgYRKiduIXqoUYujb7zDFxXhqrzPTDLLOedFQM5UMKpsmQFAOh+8PjM3Z zTGv/tFGtTrMjGaOhnuCOtAz24Izxt/GNohWWAjtJakrkE0gSVbQBSNpi4+Z90sb0cPN k7uHKx1Wn4UVewNIBHjWcs2C7aBdONSddcn7AuaYrevIjHkJarwiaw+xpksLSpX9kcBH QHwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736426688; x=1737031488; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/By/nNQiDNpIoWkmb6am6x6T/SKSKj43SsjP/pBJ2zo=; b=krvkjfJ2EPuEgj/muslhsk0b7Q0paacr9KcL90/TIIgYpaGeaDP6LRvMU181jjY7NU kmit76rsdTPdH0MZnEZvrLBI6y6UXvTGWluyg5OXJJ5FrWFZn/OiMND0r7hfzdFKm+aT I8ESeEam+2Kzp3F0Htq0CVDzqx4VFLHghFyQ4HBw7BFokAtZvphka4Z31+wbAALpsvmP j/unuMiE7/S9B9rYaan5eS1oMA5pg27pbkAjV3UBp4ldmhg0hL/j3IkcS3rF0MSq7KIo U3ECs3U77y+L5AtcOt56Xz96luZsQjyjhUf6VPSG/RxkUMoskLd495UFGX7BRdL65zWn u5SQ== X-Forwarded-Encrypted: i=1; AJvYcCUPA2rp+ZwjF0krKqJEVOYD+Qvcm6PGqpX5Ny2neUNfhwWimgP4p7YFbwW+gBKbT6On4V10AQEKy9zS <at> debbugs.gnu.org X-Gm-Message-State: AOJu0YzBR3dbLdVXhE1FAuN1wYT0uME+ofCX7PUs29xKW/F6Wx4K182E ASOwYojw+qVflY9t32PNbMeUOGLOueBV7t1kVQLnStTX2OEFNdIpaWuDldv4UXJzxiVT+o7dI79 dJ2D5i4URp3AA7oDTkitTC1rnOms= X-Gm-Gg: ASbGnctuuXnTB+4hevkywPELRxWy4O63A1YUqMC1IiVou0qX8eimjvfExpeb/WfVKCz 5MmNs1yy5/EiYmuMB33MY1ZvBdQolvjj2Oep62xaS X-Google-Smtp-Source: AGHT+IHNecbnFj50KHnzqghQxdH90qmFgK+aI4z/R78zpQJzZs9z3RJRIkR5i/LDWN6dergULnXHBKRHZmd47j2Y6kw= X-Received: by 2002:a17:907:9711:b0:aa6:1e9a:e45a with SMTP id a640c23a62f3a-ab2abdc368emr509370766b.46.1736426687986; Thu, 09 Jan 2025 04:44:47 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 9 Jan 2025 06:44:47 -0600 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87frls47uu.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> <87frls47uu.fsf@HIDDEN> MIME-Version: 1.0 Date: Thu, 9 Jan 2025 06:44:47 -0600 X-Gm-Features: AbW1kvYhkJaqwqz7IdpTPZZ8I5vUQBKWfSpShaneybNvYRdX6Y4EDBK5JQwwM9c Message-ID: <CADwFkm=EaCgrvrFh2rnJBpouWLSZX_Zmvmy7eCeaXOmbefLPaA@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: Pip Cet <pipcet@HIDDEN>, =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: Gerd Moellmann <gerd@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Pip Cet <pipcet@HIDDEN> writes: > This isn't strictly about the scratch/igc branch, but I personally think > struct hashes should be checked in all builds, mismatches should be > downgraded to #warnings, and --enable-checking=all could include > -Werror=cpp. (So the warnings would still abort a build with > --enable-checking=all, but they'd *also* show up in regular builds.) Sounds good to me. > Also, we should include them in the nativecomp ABI hash, as nativecomp > relies on struct layout and the tagging scheme in nontrivial ways > (most-positive-fixnum, for example, is treated as a compile-time > constant by comp.el, but I'm not sure all changes to it would > automatically affect the comp abi hash). I'm copying in Andrea for this part. > Changes required might include: > > * autodetection of gawk vs awk (I think this simply means using $(AWK) > rather than "awk" in src/Makefile.in; this is important on some > machines which provide a very different "awk") Using $(AWK) instead of raw "awk" makes sense, because why not. But which awk implementations are you concerned about more specifically? I would expect us to just use POSIX awk, without any gawk extensions. For example, I have had no issues building on Debian (using mawk by default) or macOS (with the BSD awk that descends from nawk, IIUC). > * igc.o and comp.o should depend explicitly on dmpstruct.h (this is > important for re-builds; in theory, the current scratch/igc branch is > broken for highly parallel builds because dmpstruct.h might be > generated after igc.o, but that is not important). Sounds good also. > * a hash-of-hashes for nativecomp > > Proposed partial patch: (I didn't look at the patch yet, though the above sounds like it might come out to more than one patch.)
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 9 Jan 2025 10:09:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 09 05:09:14 2025 Received: from localhost ([127.0.0.1]:50501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVpTW-0006Ps-B0 for submit <at> debbugs.gnu.org; Thu, 09 Jan 2025 05:09:14 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:11717) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>) id 1tVpTT-0006PZ-Di for 75451-done <at> debbugs.gnu.org; Thu, 09 Jan 2025 05:09:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736417345; x=1736676545; bh=phfayQsACxWC8dVpiaEIhi6TkuCNC/DpPv7ZXutm2xE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=EYdQ/q5NuGPUtLYlvab3k43qurnJlaqTjRHrri9xzZBea6CqWjFH2GGCF1n7eDDmz GBG6ommOgCQz1XUdLcAmP4CxsMptWkef0UHP5WJWoy+sdWwJuP7eLZ3gGseYhluRM/ 6NFPKuN8ZVi0D8fWYWSanl3TUzSz7DF4t2IBM/wLpwyuZAEVswsXOoAgGqfw+9mf/H 7bna908MZKXCI63wjemiT8Jfj/gc/FM2Excg5y8ZeAmar/yfKXC8X6vPrRRDCiB+ok 6AuMa4UvrvSFHtfzSjjNX8lZzZfKONfFGwep5f4OqvpE5eqax2UoTkOY+JwmSJWixc epLmK6PIrvPlA== Date: Thu, 09 Jan 2025 10:09:00 +0000 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> From: Pip Cet <pipcet@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS Message-ID: <87frls47uu.fsf@HIDDEN> In-Reply-To: <m2r05co3e4.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> <m2r05co3e4.fsf@HIDDEN> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 8d1b070a1bc456d65b6654f5719149764cfb2aef MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: Gerd Moellmann <gerd@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: > Stefan Kangas <stefankangas@HIDDEN> writes: > >> >>> (BTW, the contents of the #if might be out of date, not sure if we >>> meanwhile fix/scan additional structs.) >> >> I've now added checks for all structs that we use in "fix_*" functions >> (commit 76a0d739024). I kept notes to make sure I didn't miss anything, >> but it's not impossible that I did. I'll double-check things later. >> >> I plan to do anything passed to the "finalize_*" ones next, which should >> cover most of the ones we currently depend on, I think. > > Very nice! Thanks for taking this on! Thanks! This isn't strictly about the scratch/igc branch, but I personally think struct hashes should be checked in all builds, mismatches should be downgraded to #warnings, and --enable-checking=3Dall could include -Werror=3Dcpp. (So the warnings would still abort a build with --enable-checking=3Dall, but they'd *also* show up in regular builds.) Also, we should include them in the nativecomp ABI hash, as nativecomp relies on struct layout and the tagging scheme in nontrivial ways (most-positive-fixnum, for example, is treated as a compile-time constant by comp.el, but I'm not sure all changes to it would automatically affect the comp abi hash). Changes required might include: * autodetection of gawk vs awk (I think this simply means using $(AWK) rather than "awk" in src/Makefile.in; this is important on some machines which provide a very different "awk") * igc.o and comp.o should depend explicitly on dmpstruct.h (this is important for re-builds; in theory, the current scratch/igc branch is broken for highly parallel builds because dmpstruct.h might be generated after igc.o, but that is not important). * a hash-of-hashes for nativecomp Proposed partial patch: diff --git a/src/Makefile.in b/src/Makefile.in index 3d249a1abdd..f0ff9203b9d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -546,10 +546,13 @@ dmpstruct_headers=3D =09$(srcdir)/treesit.h $(srcdir)/window.h $(srcdir)/xwidget.h ifeq ($(CHECK_STRUCTS),true) pdumper.o: dmpstruct.h +igc.o: dmpstruct.h +comp.o: dmpstruct.h endif +AWK =3D @AWK@ dmpstruct.h: $(srcdir)/dmpstruct.awk dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) -=09$(AM_V_GEN)POSIXLY_CORRECT=3D1 awk -f $(srcdir)/dmpstruct.awk \ +=09$(AM_V_GEN)POSIXLY_CORRECT=3D1 $(AWK) -f $(srcdir)/dmpstruct.awk \ =09=09$(dmpstruct_headers) > $@ =20 AUTO_DEPEND =3D @AUTO_DEPEND@ diff --git a/src/comp.c b/src/comp.c index cf15817c2fc..c029572d612 100644 --- a/src/comp.c +++ b/src/comp.c @@ -24,6 +24,7 @@ #include "igc.h" #include "comp.h" #include "pdumper.h" +#include "dmpstruct.h" =20 #ifdef HAVE_NATIVE_COMP =20 @@ -821,9 +822,12 @@ hash_native_abi (void) =20 Vcomp_abi_hash =3D comp_hash_string ( - concat3 (build_string (ABI_VERSION), -=09 concat3 (Vemacs_version, Vsystem_configuration, -=09=09=09Vsystem_configuration_options), + CALLN (Fconcat, +=09 build_string (ABI_VERSION), +=09 Vemacs_version, +=09 Vsystem_configuration, +=09 Vsystem_configuration_options, +=09 build_string (HASH_DMPSTRUCT), =09 Fmapconcat (intern_c_string ("comp--subr-signature"), =09=09=09 Vcomp_subr_list, build_string ("")))); =20 diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk index e5e359e10b7..ac639082719 100644 --- a/src/dmpstruct.awk +++ b/src/dmpstruct.awk @@ -21,6 +21,7 @@ BEGIN { print "#define EMACS_DMPSTRUCT_H" struct_name =3D "" tmpfile =3D "dmpstruct.tmp" + tmpfile2 =3D "dmpstruct2.tmp" } # Match a type followed by optional syntactic whitespace /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ { @@ -29,6 +30,7 @@ BEGIN { } /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^( )?};$/ { print $0 > tmpfile + print $0 > tmpfile2 } /^( )?} *(GCALIGNED_STRUCT)? *;$/ { if (struct_name !=3D "") { @@ -41,5 +43,11 @@ BEGIN { } } END { + fflush (tmpfile2) + cmd =3D "../lib-src/make-fingerprint -r " tmpfile2 + cmd | getline hash + close (cmd) + printf "#define HASH_%s_%.10s\n", "dmpstruct", hash + printf "#define HASH_DMPSTRUCT \"%.10s\"\n", hash print "#endif /* EMACS_DMPSTRUCT_H */" } Pip
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 9 Jan 2025 07:25:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 09 02:25:18 2025 Received: from localhost ([127.0.0.1]:50216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVmus-0006tQ-9M for submit <at> debbugs.gnu.org; Thu, 09 Jan 2025 02:25:18 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:61728) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tVmuq-0006sy-8Y for 75451-done <at> debbugs.gnu.org; Thu, 09 Jan 2025 02:25:17 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3862a921123so354721f8f.3 for <75451-done <at> debbugs.gnu.org>; Wed, 08 Jan 2025 23:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736407510; x=1737012310; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5/HA+EDlww5v1zqv0UPfHYXGteTduNon21kqWKXQt/s=; b=Ac+T2U+82u1GZ0pkA2Ohaof+e1pyAU+kNTx7sZ+9lIuG2Acw6NPrZVFFTQjfDiW+W8 ro3hXXi/H5TEkfqFPGHpUnmMVpoS5wYKGMZUDtgAbzsXbDZu0bMDJ3EbuZKe3z6VssnK WOdJXpNX1ibq2pIRPGv9dAHPbgpjxzpbBwlDTGiri7/zTK9MS2yOJtBKQ1F60Wh1WpCL kD5iVMmJKE31nZX1wQM54TT+epinsgwVFB+/Bn5hgqKcIm2GcdwvNhEN4NqHvlIurOYO hPnANtcB2NjBWKKjYDqMlXy9dP6853l8fLRjalhE0SVmBqhkWm/BBpyd8rLhZkspndGJ BenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736407510; x=1737012310; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5/HA+EDlww5v1zqv0UPfHYXGteTduNon21kqWKXQt/s=; b=clG+DlIGfVF1aw8k4bwvpimaac/GqNpqyJENduZBvQmbezImx9ovkg1+2yOLZnVNXg vzfEjMglJRCFE9PZAOuun2RQBaFxqMK3FhsrgDDEZayI2eOdbI5vM8GDF/TXcL5QxiHk PCdaa64lS9VeqekI/zzFdn+YwCJ6bcrS7wAxwlU1tW87+GJiJle2x8JdooKpvFIw7cMd MFkEHGZmz/VEd5c+YUW5JVLIZXawGV16fZPH2sOlKU1ayiNJEwm6/a5aVJ4kofevf4/x Vh83JMcpUla2J2V3/Gs+UYEEfHPPviczdbEVYktw/yV9Z9VdRMlddwyTowljXHku0QkK 36jQ== X-Gm-Message-State: AOJu0Yz2Gh+YSlKEJ/+2khb30pQsotdYbXmwzpIqzgCT1kTIf7PYFF8y EGMEzRAqdv6PmSnw3yRu+taCDopqli4ljWdfqBTCvRlT1Pj42jhl X-Gm-Gg: ASbGncsDuYFkjxZxBvlqthsGRwh3Pug5tI0u0m1GHevErvvv2X1pWWGiWVt9xlB0NZJ djh4Pb1dTDih4pxxF7xozB3a6ZEWnfzUDozugvufLBcR9OuA0XfBN7YSJWg9mEIHVQvn0Cw/fKH GVg3y8XtmQwOfSeQp7f/aDkK9JFYawmlqFO9BxZyXKwUf5lOEKmsD0I2QlDw1KN7/yynQjzTE9W 6kAVU8rxvkqiLghtwV42TR1AD1kgWjvqxI7qK87KQJoX5VxhzGeMyg2rDtkJmCUz9hOZPlDOKHR jOznF77y37/8Ky34Q0/nL7MiWfInr5f1In4Y/DXwrXmPV3QZffXKWpDDpJsAHFhfBg== X-Google-Smtp-Source: AGHT+IGejuTgX9KCypTcnmIvlbTrTvz/yBsRQ+k2xpiGdaTO5OHmtHyKapKb70+7/yc6C//BvjSgwA== X-Received: by 2002:a05:6000:184e:b0:385:f64e:f163 with SMTP id ffacd0b85a97d-38a87312f41mr4358643f8f.32.1736407509676; Wed, 08 Jan 2025 23:25:09 -0800 (PST) Received: from pro2 (p200300e0b7182e00ad06de2bb2fec9f1.dip0.t-ipconnect.de. [2003:e0:b718:2e00:ad06:de2b:b2fe:c9f1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b81a4sm983127f8f.68.2025.01.08.23.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 23:25:09 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> (Stefan Kangas's message of "Thu, 9 Jan 2025 01:20:38 -0600") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> Date: Thu, 09 Jan 2025 08:25:07 +0100 Message-ID: <m2r05co3e4.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: Gerd Moellmann <gerd@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Kangas <stefankangas@HIDDEN> writes: > >> (BTW, the contents of the #if might be out of date, not sure if we >> meanwhile fix/scan additional structs.) > > I've now added checks for all structs that we use in "fix_*" functions > (commit 76a0d739024). I kept notes to make sure I didn't miss anything, > but it's not impossible that I did. I'll double-check things later. > > I plan to do anything passed to the "finalize_*" ones next, which should > cover most of the ones we currently depend on, I think. Very nice! Thanks for taking this on!
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at 75451-done) by debbugs.gnu.org; 9 Jan 2025 07:20:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 09 02:20:48 2025 Received: from localhost ([127.0.0.1]:50201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVmqW-0006e5-1X for submit <at> debbugs.gnu.org; Thu, 09 Jan 2025 02:20:48 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:55799) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tVmqU-0006df-7a for 75451-done <at> debbugs.gnu.org; Thu, 09 Jan 2025 02:20:47 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d3d14336f0so834051a12.3 for <75451-done <at> debbugs.gnu.org>; Wed, 08 Jan 2025 23:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736407240; x=1737012040; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=csj2V8v4onXXcENY8LDpP3CpZGTrutHjbvLRmUPW/HE=; b=TV+lnbWwZcjy7Wd9i+GkhDGyWIaMZHTqPlRpPzcANo8h6x8b42PmrbpZupUxuG93uX CTfUFggV5uFvtRC0yuziYBL5M9VMYqqxpWL5eBHWULmnOETgooZZkBSBD5L7OgY1ZILh K7hH8QdxXCSd8Zk23mVOD887oOgWT4B9Sqyml5SWIgOGRgIL0B9d02UgBBXrYlqKuzoZ qFvtFoVU8Hxb8rI0tLPWTJRyd9eqCgQev07JIzWQRwqmd4fPvygaP4V6yVM4lNWLFTYl pHCGgPK2XBDut7xPzSe74ts86JrJgeWHVfBnnGuCREqhBqadwXL+X1lqcLdQBw5OkStc L2jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736407240; x=1737012040; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=csj2V8v4onXXcENY8LDpP3CpZGTrutHjbvLRmUPW/HE=; b=Mv9kOIHgU/rBFE/9N2aWQpvJAfDbOQqPIHVKy9ZUBBoL9WrH/oJvtDwLrbuApaRp6L JmLzYguisQ4w3StVGuygW68JaiyxcRfgps5muEkpYTP80OFO3U3nOydu5d87QiOzyU3Q v7vw+FDtVxaBbcqgjYbOCEqwjfqy0ZDJL+2XlTxfW3TT+7DIe0XHuovfyrw0baFI2s5z iB723aKEeJE2pX2ikNJSZ5YlYvEhzJUNvU05oRe6Qbg+wdHs5e8/Jt43HV/oOgwQhXhb LiQp34VPK99YUN+bAIHiGRjWWcNYyZKvUmrrRWtR1H3LHUlBxva8y4sr4XKae9Sti0yM CHig== X-Gm-Message-State: AOJu0YwBSo9vfwFv2uKQrXgpjAVxsQz9MJVcbKtjzeKoAxqAbVmvR1hp Qypg0reDvY32At4x8QqUY3FMKem8Zdsx/bZGAFxhc2AxWOyUrkBFzepptmYpxkO54dXFNEmOGAY F2QUiH2wY86aDib1yh9aZgfGiN/qO4A== X-Gm-Gg: ASbGncuw2BBs8E1AeJhoCKM7xqaR00dywYDovUgyer2q/qanFSvzukHGQtNRJo3e0+b jjp5hFPE/D3kMx5zKJcI6ZZqe4yEz6ZcFvQJuhqc= X-Google-Smtp-Source: AGHT+IHz2iRQyAW3UbqRXJFQkg1mC5uuY1wZzi5kjgnsD88UxgBMjyZl7Yw0xVggUQLcDnEyRNB21M3zEHh3Rr7d3rw= X-Received: by 2002:a05:6402:50d2:b0:5d0:bcdd:ff90 with SMTP id 4fb4d7f45d1cf-5d972e00133mr4927631a12.2.1736407238352; Wed, 08 Jan 2025 23:20:38 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 9 Jan 2025 01:20:38 -0600 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <m2v7uoo9o0.fsf@HIDDEN> References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> <m2v7uoo9o0.fsf@HIDDEN> MIME-Version: 1.0 Date: Thu, 9 Jan 2025 01:20:38 -0600 X-Gm-Features: AbW1kvb1vf4DF7cKS4bngS0wGvqd52uZcN0y8QgslE-ygqxbuxbqJTrUpJsV1ME Message-ID: <CADwFkmkV+7Lrb5e83_Tb6mCxDP85cZE1sm3OMEzO_M0=bvAnAw@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451-done Cc: Gerd Moellmann <gerd@HIDDEN>, 75451-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes: > Stefan Kangas <stefankangas@HIDDEN> writes: > >> Severity: wishlist >> >> Gerd, how do you feel about the below change? There's no rush to make >> this change if it's inconvenient for you, but since you use IN_MY_FORK >> elsewhere, I figured that it might be okay for you here also? >> >> If it's too much trouble, let's just revisit this later. This bug >> report will serve as a reminder, if we just lave it open. >> >> diff --git a/src/igc.c b/src/igc.c >> index 079b6a90ac6..b03c64a52b8 100644 >> --- a/src/igc.c >> +++ b/src/igc.c >> @@ -76,8 +76,7 @@ >> # error "HAVE_PDUMPER required" >> #endif >> >> -#if 0 /* Not yet because that make transfer between GNU and my fork >> - painful. */ >> +#ifndef IN_MY_FORK >> #ifdef CHECK_STRUCTS >> # include "dmpstruct.h" > > No no, it's no trouble. Thanks for working on this! > > I'd even go a step further and remove the whole #if. I think it's more > useful nowadays to have the checks than to make patching easier. OK, thanks! I removed the #if on scratch/igc (commit 826491d501d). > (BTW, the contents of the #if might be out of date, not sure if we > meanwhile fix/scan additional structs.) I've now added checks for all structs that we use in "fix_*" functions (commit 76a0d739024). I kept notes to make sure I didn't miss anything, but it's not impossible that I did. I'll double-check things later. I plan to do anything passed to the "finalize_*" ones next, which should cover most of the ones we currently depend on, I think.
Stefan Kangas <stefankangas@HIDDEN>
:Stefan Kangas <stefankangas@HIDDEN>
:Received: (at 75451) by debbugs.gnu.org; 9 Jan 2025 05:09:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 09 00:09:47 2025 Received: from localhost ([127.0.0.1]:49983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVknj-0008Ml-0z for submit <at> debbugs.gnu.org; Thu, 09 Jan 2025 00:09:47 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:60684) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>) id 1tVkng-0008MP-Sk for 75451 <at> debbugs.gnu.org; Thu, 09 Jan 2025 00:09:45 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4361f664af5so6514795e9.1 for <75451 <at> debbugs.gnu.org>; Wed, 08 Jan 2025 21:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736399378; x=1737004178; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=UnRcF9cFYqKoqWqzTbBnZ5ni3F/1qBs5xvxTKqEDuHQ=; b=fL5SBcI9Byx3ICdFZRIpbjW7lqbdR/KHs5ryNH/5RZ3rWR1WuEiMPhMT9fdxpYSMRO CPj2dnY9w0hY4Tyfiyf5fRpSuQ42LLgRnTJ6fkLNgwWoKj+zyvLdVC++f6j6KWhopdwy tD5y4vnxCwpKzBpwJ1BaLCBEGuj+baELHa5iC3nhFdLIPTOOXnM3XpPQkeJkl+8terOq +55UQLXY5aqGJKUI8+Nien57pYlzr+Z1DaDwDxttcVWUtsT3OrLqRclOdhfWL8BvdqBc gr7l+ImVKRNAjnCnvihnQPXAPPV0Z+kdECAikHKH1wDw+VJPCUIyIN3iDjkgh44me3S9 pFYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736399378; x=1737004178; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UnRcF9cFYqKoqWqzTbBnZ5ni3F/1qBs5xvxTKqEDuHQ=; b=Fuux4bAP7rEeiH+B1n6XUXAmpori4mEOBMJ5U0EutSWyrIB/My+TIDlAuiqXCr+dIV s9CdoIlUV3nKXN0UCDxhhMSZ1VRteZ0lLaaVjwLo91Je9rJHHCqE2u10MZIElg300TAp jRp4/xR2cD+zW3ZpGbD+SQU1iwKHNA8g25kSHHSlFJsZCKVJ73S0Ifeb/UREZgMXeqLm samrra2J+aaLBgrQhDE3gOw07b6BDge89OTx4u1oTm7oTlEaNNNWkpCa8ZWYkqAbSb9+ lddW0zaiR/+U1u6qCUyqqFngVFwspOmAOtSX6XXpGhJ53drkjsxxkX09OwnH3LVSnyax TV6g== X-Gm-Message-State: AOJu0Yx42/TVfqXTBLmDBxWD7A5GbU34mnhwKCgQUcvodZ661LNL4fBM Up3qvhkInEqnDfXF69PDjcOhUxOe0dHe3yc+ZXP/fxvPKKvAE2Gy X-Gm-Gg: ASbGncuvLH4Ob3+CGzVCPc+F/J87pMPZLAuEE5+v64aQM+/EtDNuHJV/Ou8C2HGpRDU xIMrVC+PLuglVIGEaDnWxGn6CGAIF9vTQjw85/9KEqiEx+c2vpYL0tt2Si1N9MlffusRVnohsSL 94XWqV3WEP0y2sLg8VEVx17OQv4vtCXIkxKqJjfSsHnzSOcq2ToaFfCPH+phF9Sj4qJEbOacnhQ IVzP2knts7Uth6HRim49fFZ8gfEVbGXLGmyCRag//mx2MLV95TYgWOah+r3wRgfQh2VwwJhoUHN DPw0QFYgtt5lqymdxy+mt/iAhTDUKtI2GdT4XKVu/VpIcZO3VIXJunLj1F809eB4wg== X-Google-Smtp-Source: AGHT+IG6p9va8h6E8JR6FpsbJIJVD8GMAL0NQNxisKEIlbeSUdcFbfnRyhDeVnnpg5x7yshE0MbiOQ== X-Received: by 2002:a5d:5986:0:b0:385:e37a:2a56 with SMTP id ffacd0b85a97d-38a8733a214mr4628355f8f.52.1736399378249; Wed, 08 Jan 2025 21:09:38 -0800 (PST) Received: from pro2 (p200300e0b7182e00ad06de2bb2fec9f1.dip0.t-ipconnect.de. [2003:e0:b718:2e00:ad06:de2b:b2fe:c9f1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1ca9sm680682f8f.92.2025.01.08.21.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 21:09:37 -0800 (PST) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS In-Reply-To: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> (Stefan Kangas's message of "Wed, 8 Jan 2025 21:57:06 -0600") References: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> Date: Thu, 09 Jan 2025 06:09:35 +0100 Message-ID: <m2v7uoo9o0.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75451 Cc: Gerd Moellmann <gerd@HIDDEN>, 75451 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Kangas <stefankangas@HIDDEN> writes: > Severity: wishlist > > Gerd, how do you feel about the below change? There's no rush to make > this change if it's inconvenient for you, but since you use IN_MY_FORK > elsewhere, I figured that it might be okay for you here also? > > If it's too much trouble, let's just revisit this later. This bug > report will serve as a reminder, if we just lave it open. > > diff --git a/src/igc.c b/src/igc.c > index 079b6a90ac6..b03c64a52b8 100644 > --- a/src/igc.c > +++ b/src/igc.c > @@ -76,8 +76,7 @@ > # error "HAVE_PDUMPER required" > #endif > > -#if 0 /* Not yet because that make transfer between GNU and my fork > - painful. */ > +#ifndef IN_MY_FORK > #ifdef CHECK_STRUCTS > # include "dmpstruct.h" No no, it's no trouble. Thanks for working on this! I'd even go a step further and remove the whole #if. I think it's more useful nowadays to have the checks than to make patching easier. (BTW, the contents of the #if might be out of date, not sure if we meanwhile fix/scan additional structs.)
bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 9 Jan 2025 03:57:17 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 08 22:57:16 2025 Received: from localhost ([127.0.0.1]:49841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tVjfY-00050C-JV for submit <at> debbugs.gnu.org; Wed, 08 Jan 2025 22:57:16 -0500 Received: from lists.gnu.org ([2001:470:142::17]:41656) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tVjfX-0004zx-G7 for submit <at> debbugs.gnu.org; Wed, 08 Jan 2025 22:57:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>) id 1tVjfR-0002aA-Mu for bug-gnu-emacs@HIDDEN; Wed, 08 Jan 2025 22:57:09 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>) id 1tVjfQ-0004Zh-9n for bug-gnu-emacs@HIDDEN; Wed, 08 Jan 2025 22:57:09 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso675954a12.3 for <bug-gnu-emacs@HIDDEN>; Wed, 08 Jan 2025 19:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736395027; x=1736999827; darn=gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=8xrwvKkTtVhawjRXBu4LW93r8fW1e/7sihOBUg3gCHE=; b=g1foicyPaDIBselVtkGPg2FND//dfdm70pWNeMpfF2LNc/Hwu8hC1jRaHKSo2NHIY4 9lhj52m2yREJlW1AYBCSSITZJhrvVJGT9WQvnT400k1oOi32Sj6bjs199aTPjUMdLgpw hRxKdZCWadnnluU+KX+1zPTDCyg5ENSy4ULt6e9ebisg3C7vtQuULxkmyh/c+9Ar+Ojn g4VVr4IuGdPMYqloIy3BkmtSE/9tfy4wyn2fjQOuirNbRpF8D0kS34IhSKsbXRgG5Oqy FBv1yGQ506yJkByjRuFfMnD7ebXEVAe6eWDlH5FMQbkI9j44RGEUfFwskzaRfin5mEq6 rs5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736395027; x=1736999827; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8xrwvKkTtVhawjRXBu4LW93r8fW1e/7sihOBUg3gCHE=; b=ZhKVBLMa7gUjkveWNbfHuuqEdncwweRjGGJM2T8xrM++TItHRoS5p5M+ucmFUov0kN bo2JPjT148VpN7l1gRhCtft7appt3PiHcFHX1R3PjVtK+EwQP9kPtvH9Fpe4WDVAAAX7 hFFXlnEDnkfbaw/CAOMaJh2BNDH/p0SdxSwJKqwP7eVy/Byy+ZcHfSNvL1kTGRxSEd5y /p15WN5v6/KzwOf4YcCIkJBoKULJWBsbblSXeweVUPcuSYqywi+T7ccJHHyfyKwDEq+u P9p3ErbUzC6J28d1j5XPpY5+BzFZt6KwZTRd2ZM43XT1otIMWV5hy3f35tB+ewFJ3ibS Eikg== X-Gm-Message-State: AOJu0YyTn7GG8fGIpToffD0Dk5bQdw83UJe3PywCF9CLYhmoQFb5MB+0 4e1AEMI3+3x+UFqeer3PMdEQLiaochRTw57FRO9BNfvOpIkJEZ6G8MtS8pTueSGywdSD06+tcV5 m2EAYr8cdSAVbgYbc8QEjOUAwMU+GOA== X-Gm-Gg: ASbGncvOzA89wXWfKmPrV7TDWSW0krKOaJUBroy6uMwtVFfZrGlcf8SHElqDL3e3E2m EnSO2jQgmCjUpGPsv7VCM54Te+TavMv/oQRToQ+EU X-Google-Smtp-Source: AGHT+IE5+yWgShzecdWL3Dr1AHYnfQTvr8PZnAH7LHrY8jkS1MDveDv60jsKioJiXH3p/8AXNj5gAn3e9yIuJS4g36w= X-Received: by 2002:a05:6402:354a:b0:5d2:7396:b0ed with SMTP id 4fb4d7f45d1cf-5d972e0e3abmr11166289a12.14.1736395026579; Wed, 08 Jan 2025 19:57:06 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 8 Jan 2025 21:57:06 -0600 From: Stefan Kangas <stefankangas@HIDDEN> X-Debbugs-CC: Gerd Moellmann <gerd@HIDDEN> MIME-Version: 1.0 Date: Wed, 8 Jan 2025 21:57:06 -0600 X-Gm-Features: AbW1kvad3vU71_Yht6AxfruMW_siYUHtT_j0-Jc6OWJbr4ohI8WZoGuvuI8bjPs Message-ID: <CADwFkmnSngLQg7sLdjZMYe9i14McUawAm=ns+o1_nqFkH98oPg@HIDDEN> Subject: scratch/igc: Enable CHECK_STRUCTS To: bug-gnu-emacs@HIDDEN Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=stefankangas@HIDDEN; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Severity: wishlist Gerd, how do you feel about the below change? There's no rush to make this change if it's inconvenient for you, but since you use IN_MY_FORK elsewhere, I figured that it might be okay for you here also? If it's too much trouble, let's just revisit this later. This bug report will serve as a reminder, if we just lave it open. diff --git a/src/igc.c b/src/igc.c index 079b6a90ac6..b03c64a52b8 100644 --- a/src/igc.c +++ b/src/igc.c @@ -76,8 +76,7 @@ # error "HAVE_PDUMPER required" #endif -#if 0 /* Not yet because that make transfer between GNU and my fork - painful. */ +#ifndef IN_MY_FORK #ifdef CHECK_STRUCTS # include "dmpstruct.h"
Stefan Kangas <stefankangas@HIDDEN>
:gerd@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.gerd@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#75451
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.