From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118668 invoked by alias); 29 Oct 2019 19:22:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 118657 invoked by uid 89); 29 Oct 2019 19:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=ps2, PS2 X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Oct 2019 19:22:19 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id CE42520C06; Tue, 29 Oct 2019 15:22:17 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id B210720C06; Tue, 29 Oct 2019 15:22:16 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 9EED220AF6; Tue, 29 Oct 2019 15:22:16 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Tue, 29 Oct 2019 19:22:00 -0000 From: "Tom Tromey (Code Review)" To: Christian Biesinger , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v2] Add static_asserts for the sizes of space-critical structs X-Gerrit-Change-Id: Idd68320aa3e79ee7cc749019724636a58ce4b9c6 X-Gerrit-Change-Number: 306 X-Gerrit-ChangeURL: X-Gerrit-Commit: bbafc97c7e2d3f28ec97fa65f5d5f46f3a67379a In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 29 Oct 2019 15:22:16 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191029192216.9EED220AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg01044.txt.bz2 Tom Tromey has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/306 ...................................................................... Patch Set 2: Code-Review+1 (1 comment) I think these spots should maybe come with a short comment explaining that the assert is just to make sure you don't change the size by accident. That way people changing the size on purpose will know they can just update the assert. WDYT? https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/306/2/gdb/symtab.h File gdb/symtab.h: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/306/2/gdb/symtab.h@1189 PS2, Line 1189: 1180 | /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better 1181 | to add a magic symbol to the block containing this information, 1182 | or to have a generic debug info annotation slot for symbols. */ 1183 | 1184 | void *aux_value; 1185 | 1186 | struct symbol *hash_next; 1187 | }; 1188 | 1189 | gdb_static_assert ((sizeof (void *) == 8 && sizeof (symbol) == 72) || || at the start of the next line. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: Idd68320aa3e79ee7cc749019724636a58ce4b9c6 Gerrit-Change-Number: 306 Gerrit-PatchSet: 2 Gerrit-Owner: Christian Biesinger Gerrit-Reviewer: Tom Tromey Gerrit-Comment-Date: Tue, 29 Oct 2019 19:22:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment