all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
       [not found] ` <20220927002456.D4AC2C11D7D@vcs2.savannah.gnu.org>
@ 2022-09-27  2:47   ` Po Lu
  2022-09-27  3:26     ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 4+ messages in thread
From: Po Lu @ 2022-09-27  2:47 UTC (permalink / raw)
  To: emacs-devel; +Cc: YAMAMOTO Mitsuharu

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> branch: master
> commit cd88f6de4be1f8eba1db038b371d769f584be53b
> Author: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Commit: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
>
>     Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
>     
>     * src/composite.c (composition_gstring_adjust_zero_width): New function.
>     * src/composite.h: Declare it.
>     * src/font.c (Ffont_shape_gstring): Use it before putting gstring to cache.

This gives:

In file included from composite.c:29:
In function ‘AREF’,
    inlined from ‘composition_gstring_adjust_zero_width’ at composite.c:839:11:
lisp.h:1941:35: warning: ‘glyph’ may be used uninitialized [-Wmaybe-uninitialized]
 1941 |   return XVECTOR (array)->contents[idx];
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
composite.c: In function ‘composition_gstring_adjust_zero_width’:
composite.c:816:19: note: ‘glyph’ was declared here
  816 |       Lisp_Object glyph;
      |                   ^~~~~



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

* Re: master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
  2022-09-27  2:47   ` master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951) Po Lu
@ 2022-09-27  3:26     ` YAMAMOTO Mitsuharu
  2022-09-27  3:33       ` Po Lu
  0 siblings, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2022-09-27  3:26 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

On Tue, 27 Sep 2022 11:47:25 +0900,
Po Lu wrote:
> 
> YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:
> 
> > branch: master
> > commit cd88f6de4be1f8eba1db038b371d769f584be53b
> > Author: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> > Commit: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> >
> >     Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
> >     
> >     * src/composite.c (composition_gstring_adjust_zero_width): New function.
> >     * src/composite.h: Declare it.
> >     * src/font.c (Ffont_shape_gstring): Use it before putting gstring to cache.
> 
> This gives:
> 
> In file included from composite.c:29:
> In function ‘AREF’,
>     inlined from ‘composition_gstring_adjust_zero_width’ at composite.c:839:11:
> lisp.h:1941:35: warning: ‘glyph’ may be used uninitialized [-Wmaybe-uninitialized]
>  1941 |   return XVECTOR (array)->contents[idx];
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
> composite.c: In function ‘composition_gstring_adjust_zero_width’:
> composite.c:816:19: note: ‘glyph’ was declared here
>   816 |       Lisp_Object glyph;
>       |                   ^~~~~
> 

This is a false alarm.  The variable `glyph' is left uninitialized
only when i == LGSTRING_GLYPH_LEN (gstring), and all the uses are
guarded by this condition.  So the usual practice is to add UNINIT in
this case?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp



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

* Re: master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
  2022-09-27  3:26     ` YAMAMOTO Mitsuharu
@ 2022-09-27  3:33       ` Po Lu
  2022-09-27  3:46         ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 4+ messages in thread
From: Po Lu @ 2022-09-27  3:33 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> This is a false alarm.  The variable `glyph' is left uninitialized
> only when i == LGSTRING_GLYPH_LEN (gstring), and all the uses are
> guarded by this condition.  So the usual practice is to add UNINIT in
> this case?

Yes, that'd be fine.

Thanks.




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

* Re: master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951)
  2022-09-27  3:33       ` Po Lu
@ 2022-09-27  3:46         ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2022-09-27  3:46 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

On Tue, 27 Sep 2022 12:33:37 +0900,
Po Lu wrote:
> 
> YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:
> 
> > This is a false alarm.  The variable `glyph' is left uninitialized
> > only when i == LGSTRING_GLYPH_LEN (gstring), and all the uses are
> > guarded by this condition.  So the usual practice is to add UNINIT in
> > this case?
> 
> Yes, that'd be fine.

Thanks.

On second thought, I made the variable always initialized and
also unify the exit conditions.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp



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

end of thread, other threads:[~2022-09-27  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <166423829576.7468.2672204708444997712@vcs2.savannah.gnu.org>
     [not found] ` <20220927002456.D4AC2C11D7D@vcs2.savannah.gnu.org>
2022-09-27  2:47   ` master cd88f6de4b: Adjust zero-width grapheme clusters so they are displayed (Bug#50951) Po Lu
2022-09-27  3:26     ` YAMAMOTO Mitsuharu
2022-09-27  3:33       ` Po Lu
2022-09-27  3:46         ` YAMAMOTO Mitsuharu

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.