all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
@ 2021-12-04 12:35 dick
  2021-12-04 19:18 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: dick @ 2021-12-04 12:35 UTC (permalink / raw)
  To: 52276

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Scuttle-a-compiler-warning-under-enable-checking.patch --]
[-- Type: text/x-diff, Size: 1447 bytes --]

From 2f1a3475910bfea5d0c0ead874a238db3ecbf3ad Mon Sep 17 00:00:00 2001
From: dickmao <dick.r.chiang@gmail.com>
Date: Sat, 4 Dec 2021 07:32:00 -0500
Subject: [PATCH] Scuttle a compiler warning under --enable-checking

* src/image.c (webp_load): Scuttle compiler warning.
---
 src/image.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/image.c b/src/image.c
index b85c405487..709abc21aa 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8970,7 +8970,7 @@ webp_load (struct frame *f, struct image *img)
 {
   ptrdiff_t size = 0;
   uint8_t *contents;
-  Lisp_Object file;
+  Lisp_Object file = Qnil;
 
   /* Open the WebP file.  */
   Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL);
@@ -9007,7 +9007,7 @@ webp_load (struct frame *f, struct image *img)
   /* Validate the WebP image header.  */
   if (!WebPGetInfo (contents, size, NULL, NULL))
     {
-      if (NILP (specified_data))
+      if (! NILP (file))
 	image_error ("Not a WebP file: `%s'", file);
       else
 	image_error ("Invalid header in WebP image data");
@@ -9030,7 +9030,7 @@ webp_load (struct frame *f, struct image *img)
     case VP8_STATUS_USER_ABORT:
     default:
       /* Error out in all other cases.  */
-      if (NILP (specified_data))
+      if (! NILP (file))
 	image_error ("Error when interpreting WebP image data: `%s'", file);
       else
 	image_error ("Error when interpreting WebP image data");
-- 
2.26.2


[-- Attachment #2: Type: text/plain, Size: 6613 bytes --]




In Commercial Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
 of 2021-12-04 built on dick
Repository revision: 496cf662a994ab288a4fb75f70ceb053af27a2a9
Repository branch: dev
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.4 LTS

Configured using:
 'configure --prefix=/home/dick/.local --enable-checking
 --with-tree-sitter --enable-dumping-overwrite 'CFLAGS=-g3 -Og
 -I/home/dick/.local/include/' LDFLAGS=-L/home/dick/.local/lib'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
TREE-SITTER LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Magit

Minor modes in effect:
  async-bytecomp-package-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  projectile-mode: t
  flx-ido-mode: t
  override-global-mode: t
  global-hl-line-mode: t
  winner-mode: t
  tooltip-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode
/home/dick/.emacs.d/elpa/hydra-20170924.2259/lv hides /home/dick/.emacs.d/elpa/lv-20191106.1238/lv
/home/dick/.emacs.d/elpa/magit-3.3.0/magit-section-pkg hides /home/dick/.emacs.d/elpa/magit-section-3.3.0/magit-section-pkg
/home/dick/org-gcal.el/org-gcal hides /home/dick/.emacs.d/elpa/org-gcal-0.3/org-gcal
/home/dick/.emacs.d/elpa/tree-sitter-0.15.2/tree-sitter hides /home/dick/.local/share/emacs/28.0.50/lisp/tree-sitter
/home/dick/.emacs.d/lisp/json hides /home/dick/.local/share/emacs/28.0.50/lisp/json
/home/dick/.emacs.d/elpa/transient-0.3.6/transient hides /home/dick/.local/share/emacs/28.0.50/lisp/transient
/home/dick/.emacs.d/elpa/hierarchy-20171221.1151/hierarchy hides /home/dick/.local/share/emacs/28.0.50/lisp/emacs-lisp/hierarchy

Features:
(shadow sort footnote mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum shr pixel-fill kinsoku svg dom gnus-group
mm-url gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range gnus-win emacsbug sendmail benchmark vc cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
vc-git vc-dispatcher bug-reference face-remap magit-patch-changelog
magit-patch magit-submodule magit-obsolete magit-popup async-bytecomp
async magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff diff-mode git-commit log-edit message yank-media rmc
puny dired-x dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068
epg-config mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
pcvs-util add-log magit-core magit-margin magit-transient magit-process
with-editor shell pcomplete server magit-mode transient format-spec
paredit-ext paredit subed subed-vtt subed-srt subed-common subed-mpv
subed-debug subed-config inf-ruby ruby-mode smie company pcase
haskell-interactive-mode haskell-presentation-mode haskell-process
haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support noutline outline
flymake-proc flymake warnings etags fileloop generator xref project
dabbrev haskell-customize hydra lv use-package-ensure solarized-theme
solarized-definitions projectile lisp-mnt mail-parse rfc2231 ibuf-ext
ibuffer ibuffer-loaddefs thingatpt magit-autorevert autorevert
filenotify magit-git magit-section magit-utils crm dash rx grep compile
comint ansi-color gnus nnheader gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils text-property-search
time-date flx-ido flx google-translate-default-ui
google-translate-core-ui facemenu color ido google-translate-core
google-translate-tk google-translate-backend use-package-bind-key
bind-key auto-complete easy-mmode advice edmacro kmacro popup cus-edit
pp cus-load wid-edit emms-player-mplayer emms-player-simple emms
emms-compat cl-extra help-mode use-package-core derived hl-line winner
ring finder-inf json-reformat-autoloads json-snatcher-autoloads
sml-mode-autoloads tornado-template-mode-autoloads info package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq gv subr-x byte-opt bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tree-sitter tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget keymap hashtable-print-readable backquote threads
dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 475721 14692)
 (symbols 48 33157 1)
 (strings 32 119335 3487)
 (string-bytes 1 4084749)
 (vectors 16 48784)
 (vector-slots 8 611093 13083)
 (floats 8 409 442)
 (intervals 56 544 2)
 (buffers 992 14))

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
  2021-12-04 12:35 bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c dick
@ 2021-12-04 19:18 ` Lars Ingebrigtsen
  2021-12-04 19:36   ` dick
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-04 19:18 UTC (permalink / raw)
  To: dick; +Cc: 52276

dick <dick.r.chiang@gmail.com> writes:

> * src/image.c (webp_load): Scuttle compiler warning.

[...]

> +  Lisp_Object file = Qnil;

What gcc version gives you a warning?  I'm not seeing a warning in

gcc (Debian 10.2.1-6) 10.2.1 20210110

or

gcc (Debian 11.2.0-10) 11.2.0

and the warning seems spurious to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
  2021-12-04 19:18 ` Lars Ingebrigtsen
@ 2021-12-04 19:36   ` dick
  2021-12-05 21:22     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: dick @ 2021-12-04 19:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52276

I only recently discovered --enable-checking.  And here I thought all my
easserts were actually in force.

>>>>> Lars Ingebrigtsen <larsi@gnus.org> writes:

> dick <dick.r.chiang@gmail.com> writes:
>> * src/image.c (webp_load): Scuttle compiler warning.

> [...]

>> +  Lisp_Object file = Qnil;

> What gcc version gives you a warning?  I'm not seeing a warning in

> gcc (Debian 10.2.1-6) 10.2.1 20210110

> or

> gcc (Debian 11.2.0-10) 11.2.0

> and the warning seems spurious to me.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
  2021-12-04 19:36   ` dick
@ 2021-12-05 21:22     ` Lars Ingebrigtsen
  2021-12-05 22:12       ` dick
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-05 21:22 UTC (permalink / raw)
  To: dick; +Cc: 52276

dick <dick.r.chiang@gmail.com> writes:

> I only recently discovered --enable-checking.  And here I thought all my
> easserts were actually in force.

[...]

>> What gcc version gives you a warning?

You didn't answer my question, but:

> System Description: Ubuntu 18.04.4 LTS

So I guess it's an old gcc version.

Looking at the function in question again, the warning seems spurious.
We do cater to compiler bugs, but not for older gcc versions (which I
have to guess you're using, since you didn't answer), so I'm closing
this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
  2021-12-05 21:22     ` Lars Ingebrigtsen
@ 2021-12-05 22:12       ` dick
  2021-12-05 22:28         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: dick @ 2021-12-05 22:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52276

> You didn't answer my question, but:

My bad: 

gcc-10 (Ubuntu 10.3.0-1ubuntu1~18.04~1) 10.3.0

I dodged your question with some blather about "--enable-checking"
because the warning doesn't manifest without that configure switch.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c
  2021-12-05 22:12       ` dick
@ 2021-12-05 22:28         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-05 22:28 UTC (permalink / raw)
  To: dick; +Cc: 52276

dick <dick.r.chiang@gmail.com> writes:

> My bad: 
>
> gcc-10 (Ubuntu 10.3.0-1ubuntu1~18.04~1) 10.3.0

Ah, I see...  Ah!  I didn't see the warning on Debian stable because I
didn't have libwebp installed there.  And the compiler bug is apparently
gone in gcc 11.

But since the warning is manifesting in the current release of a major
distribution, I think adding a workaround is in order, and I'm applying
your patch to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-05 22:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-04 12:35 bug#52276: 28.0.50; [PATCH] Scuttle compiler warning in image.c dick
2021-12-04 19:18 ` Lars Ingebrigtsen
2021-12-04 19:36   ` dick
2021-12-05 21:22     ` Lars Ingebrigtsen
2021-12-05 22:12       ` dick
2021-12-05 22:28         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.