From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel,gmane.emacs.diffs Subject: Re: master updated (05b7953 -> b2b1ccb) Date: Mon, 20 May 2019 12:47:07 -0600 Message-ID: <87r28tufo4.fsf@gmail.com> References: <20190520020459.10030.99221@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="23110"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-diffs@gnu.org, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 20 20:48:04 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSnKN-0005uf-Uk for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 20:48:04 +0200 Original-Received: from localhost ([127.0.0.1]:40359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSnKM-0007hk-83 for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 14:48:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSnJe-0007hX-Ql for emacs-devel@gnu.org; Mon, 20 May 2019 14:47:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSnJd-0006E9-4N for emacs-devel@gnu.org; Mon, 20 May 2019 14:47:18 -0400 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:36109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSnJX-00069u-FM; Mon, 20 May 2019 14:47:15 -0400 Original-Received: by mail-pf1-x431.google.com with SMTP id v80so7657885pfa.3; Mon, 20 May 2019 11:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bt2LoUCy4SHfIybzbhFr1kM/ONXxoI7ceSMdV0jywv8=; b=lg63u3MzM5tdkqjWioNJjKbzrK5LK/IRjiUTGffovoTND2v1YU4BCXOxW9GP65kHLv uagy5nGb2aztAqW6idrHCwR7V/Eft0k6TdhYkSK324KJWhVywDuDP2TjDkmterKMM2Ab pgXPBirTt9oiNB2rVJbcaj/Q4vahIIQKpwo/iUdZXxVDQUpvOkI4Kw3qNoOh4q4c3fmN 5ZnJvcFHX/9scOdOJgj7vJgjsBHu8Yk3/VRNcoYHYgHkfgDqqJyf9G2/+hu74eGMRQI+ RT/i8jHmLwuG2KiOvLRoZr0xKCzQNioSNnjLeoSGIGXYTmwUAEmu4APqluk5iZ95Rfzw b90A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bt2LoUCy4SHfIybzbhFr1kM/ONXxoI7ceSMdV0jywv8=; b=hg/c5S2flBS/NaKGVE42/PLteFhknFPY+RURnSt4LNEgF145FeVsnvPSh4TCtH0Xhx pQY/rRbnxuOwmIjPlF1DOwFTbPtm92dUI9l2XI+qZCgS5rEQMGL/eD92aGlOjpayq988 PpeFbFzAWg1WPr46XJVHDoFBRDeaQY3Nfsii3YuM+1Nb2b/h8ayQ4HpO2+qQVh6i+DrQ 31p90of+PaCMcr83htM/Ne+inH8fag0JnpZIbXKeCeYTVEN5g3aDB3R4nPiErcPAanx4 vZRF1+pirCgMB2cmZfp5z0k5L/GaQ41R0qQ4StuBhv+B9Ps/vPBPhvIqqIO4B0UO6PWS pWWw== X-Gm-Message-State: APjAAAWsJqd7Ahi10bBKjeyYJmwOf5urSIwz+l+O9tS4Eew/kBMidgLR zjXlNn0EJSnSpvaF3BN+tYemo18a X-Google-Smtp-Source: APXvYqyBpVMEVMYxUw5Z5UZcOMW2yTUhapG6OxYf1R8bsUWWZLzBRjKLJp0h8O3I8j0gc33WelBnzg== X-Received: by 2002:aa7:99dd:: with SMTP id v29mr83487561pfi.252.1558378024997; Mon, 20 May 2019 11:47:04 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id t5sm20481307pgn.80.2019.05.20.11.47.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 11:47:04 -0700 (PDT) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 20 May 2019 14:09:22 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::431 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236815 gmane.emacs.diffs:150211 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > This patch series seems to introduce the following warnings? > > xdisp.c: In function =E2=80=98normal_char_ascent_descent=E2=80=99: > xdisp.c:26433:13: warning: potential null pointer dereference [-Wnull-der= eference] > if (!(pcm->width =3D=3D 0 && pcm->rbearing =3D=3D 0 && pcm->lbearing = =3D=3D 0)) > ~~~^~~~~~~ > xdisp.c: In function =E2=80=98gui_produce_glyphs=E2=80=99: > xdisp.c:28482:15: warning: potential null pointer dereference [-Wnull-der= eference] > if (pcm->width =3D=3D 0 > ~~~^~~~~~~ > xdisp.c:28745:16: warning: potential null pointer dereference [-Wnull-der= eference] > if (pcm->width =3D=3D 0 > ~~~^~~~~~~ Hmm, this is weird: the warnings seem to be legitimate (get_per_char_metric can return NULL), but I don't see how my patch would _introduce_ these warnings. Also, I don't get these warnings; what's your compiler version? If it's GCC 9, perhaps the warning detection has improved. I don't suppose you happened to update your compiler at the same time as updating your local branch? It's good to plug these anyway, but it would be nice to figure out why they're only popping up now. The below diff should silence the warnings. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=pcm.diff Content-Description: pcm diff --git a/src/xdisp.c b/src/xdisp.c index c561ea9e36..ca95f8f944 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -26430,7 +26430,10 @@ normal_char_ascent_descent (struct font *font, int c, int *ascent, int *descent) { struct font_metrics *pcm = get_per_char_metric (font, &char2b); - if (!(pcm->width == 0 && pcm->rbearing == 0 && pcm->lbearing == 0)) + if (!(pcm + && pcm->width == 0 + && pcm->rbearing == 0 + && pcm->lbearing == 0)) { /* We add 1 pixel to character dimensions as heuristics that produces nicer display, e.g. when the face has @@ -28479,8 +28482,10 @@ gui_produce_glyphs (struct it *it) if (get_char_glyph_code (it->char_to_display, font, &char2b)) { pcm = get_per_char_metric (font, &char2b); - if (pcm->width == 0 - && pcm->rbearing == 0 && pcm->lbearing == 0) + if (pcm + && pcm->width == 0 + && pcm->rbearing == 0 + && pcm->lbearing == 0) pcm = NULL; } @@ -28742,8 +28747,10 @@ gui_produce_glyphs (struct it *it) if (get_char_glyph_code (' ', font, &char2b)) { pcm = get_per_char_metric (font, &char2b); - if (pcm->width == 0 - && pcm->rbearing == 0 && pcm->lbearing == 0) + if (pcm + && pcm->width == 0 + && pcm->rbearing == 0 + && pcm->lbearing == 0) pcm = NULL; } --=-=-=--