GNU bug report logs - #43195
[PATCH] Remove definitions of UP, BC and PC which should be provided by terminfo

Previous Next

Package: emacs;

Reported by: Fangrui Song <maskray <at> google.com>

Date: Fri, 4 Sep 2020 05:08:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 43195 <at> debbugs.gnu.org (full text, mbox):

From: Fāng-ruì Sòng <maskray <at> google.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 43195 <at> debbugs.gnu.org
Subject: Re: bug#43195: [PATCH] Remove definitions of UP, BC and PC which
 should be provided by terminfo
Date: Sat, 12 Sep 2020 00:33:27 -0700
On Sat, Sep 12, 2020 at 12:19 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > Date: Fri, 4 Sep 2020 08:38:03 -0700
> > From: Fangrui Song <maskray <at> google.com>
> > Cc: 43195 <at> debbugs.gnu.org
> >
> > >diff --git a/src/terminfo.c b/src/terminfo.c
> > >index 51fd32e..0765996 100644
> > >--- a/src/terminfo.c
> > >+++ b/src/terminfo.c
> > >@@ -23,9 +23,12 @@
> > >
> > > /* Define these variables that serve as global parameters to termcap,
> > >    so that we do not need to conditionalize the places in Emacs
> > >-   that set them.  */
> > >+   that set them.  But don't do that for terminfo, as that could
> > >+   cause link errors when using -fno-common.  */
> > >
> > >+#if !TERMINFO
> > > char *UP, *BC, PC;
> > >+#endif
> > >
> > > /* Interface to curses/terminfo library.
> > >    Turns out that all of the terminfo-level routines look
> > >
> >
> > Looks great! Thanks!
>
> Thanks, installed for Emacs 27.2.
>
> > One nit,
> >
> >    #if !TERMINFO
> >
> > probably should be
> >
> >    #ifndef TERMINFO
>
> That's the same thing with modern compilers.
>
> > I don't know whether it is worth mentioning that -fcommon/-fno-common does not
> > cause a linker error when libtinfo.so is linked (a common/regular definition
> > preempts a shared definition).
> >
> > -fno-common + libtinfo.a => multiple definition error
>
> OK, but the change works even in these other cases, right?

Yep! The new code should work in other cases, -fcommon/-fno-common x
libtinfo.a/libtinfo.so




This bug report was last modified 4 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.