git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tig] compilation error: undefined reference to `set_tabsize'
@ 2010-09-20 17:42 Nicolas Sebrecht
  2010-09-20 18:36 ` Stefan Näwe
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Sebrecht @ 2010-09-20 17:42 UTC (permalink / raw)
  To: stefan.naewe; +Cc: Nicolas Sebrecht, fonseca, git

Hi,

tig don't compile anymore here:

  % make
  gcc   tig.o  -lncursesw  -o tig
  tig.o: In function `init_display': tig.c:7113: undefined reference to `set_tabsize'
  collect2: ld returned 1 exit status
  make: *** [tig] Error 1
  %


and bisected on

commit f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d
Author: Stefan Naewe <>
Date:   Sun Sep 12 11:03:52 2010 +0200

    Use function set_tabsize()
    
    this fixes the following compile error on cygwin:
    tig.c: In function `init_display':
    tig.c:7112: error: invalid lvalue in assignment
    
    Signed-off-by: Stefan Naewe <>
    Signed-off-by: Jonas Fonseca <>


Or did I missed something?

-- 
Nicolas Sebrecht

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

* Re: [tig] compilation error: undefined reference to `set_tabsize'
  2010-09-20 17:42 [tig] compilation error: undefined reference to `set_tabsize' Nicolas Sebrecht
@ 2010-09-20 18:36 ` Stefan Näwe
  2010-09-20 20:43   ` [tig] " Nicolas Sebrecht
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Näwe @ 2010-09-20 18:36 UTC (permalink / raw)
  To: git

Nicolas Sebrecht <nicolas.s.dev <at> gmx.fr> writes:

> 
> Hi,
> 
> tig don't compile anymore here:
> 
>   % make
>   gcc   tig.o  -lncursesw  -o tig
>   tig.o: In function `init_display': tig.c:7113: undefined reference to 
`set_tabsize'
>   collect2: ld returned 1 exit status
>   make: *** [tig] Error 1
>   %
> 
> and bisected on
> 
> commit f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d
> Author: Stefan Naewe <>
> Date:   Sun Sep 12 11:03:52 2010 +0200
> 
>     Use function set_tabsize()
> 
>     this fixes the following compile error on cygwin:
>     tig.c: In function `init_display':
>     tig.c:7112: error: invalid lvalue in assignment

That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6


Maybe you should say something about your system/OS version ?

Regards,

Stefan

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

* [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 18:36 ` Stefan Näwe
@ 2010-09-20 20:43   ` Nicolas Sebrecht
  2010-09-20 21:48     ` Jonas Fonseca
  2010-09-20 23:05     ` Kumar Appaiah
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Sebrecht @ 2010-09-20 20:43 UTC (permalink / raw)
  To: Stefan Näwe; +Cc: git, Nicolas Sebrecht

The 20/09/10, Stefan Näwe wrote:
> Nicolas Sebrecht <nicolas.s.dev <at> gmx.fr> writes:
> 
> > 
> > Hi,
> > 
> > tig don't compile anymore here:
> > 
> >   % make
> >   gcc   tig.o  -lncursesw  -o tig
> >   tig.o: In function `init_display': tig.c:7113: undefined reference to 
> `set_tabsize'
> >   collect2: ld returned 1 exit status
> >   make: *** [tig] Error 1
> >   %
> > 
> > and bisected on
> > 
> > commit f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d
> > Author: Stefan Naewe <>
> > Date:   Sun Sep 12 11:03:52 2010 +0200
> > 
> >     Use function set_tabsize()
> > 
> >     this fixes the following compile error on cygwin:
> >     tig.c: In function `init_display':
> >     tig.c:7112: error: invalid lvalue in assignment
> 
> That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6
> 
> Maybe you should say something about your system/OS version ?

Naturally. I'm running on Gentoo.

  % gcc -v
  Using built-in specs.
  Target: x86_64-pc-linux-gnu
  Configured with:
  /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
  --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2
  --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include
  --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2
  --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man
  --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info
  --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4
  --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
  --enable-nls --without-included-gettext --with-system-zlib
  --disable-checking --disable-werror --enable-secureplt --enable-multilib
  --enable-libmudflap --disable-libssp --enable-java-awt=gtk
  --enable-languages=c,c++,java,treelang,fortran --enable-shared
  --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
  Thread model: posix
  gcc version 4.1.2 (Gentoo 4.1.2 p1.3)
  %

-- 
Nicolas Sebrecht

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

* Re: [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 20:43   ` [tig] " Nicolas Sebrecht
@ 2010-09-20 21:48     ` Jonas Fonseca
  2010-09-20 23:05     ` Kumar Appaiah
  1 sibling, 0 replies; 9+ messages in thread
From: Jonas Fonseca @ 2010-09-20 21:48 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: Stefan Näwe, git

On Mon, Sep 20, 2010 at 16:43, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote:
> The 20/09/10, Stefan Näwe wrote:
>> Nicolas Sebrecht <nicolas.s.dev <at> gmx.fr> writes:
>>
>> > tig don't compile anymore here:
>> >
>> >   % make
>> >   gcc   tig.o  -lncursesw  -o tig
>> >   tig.o: In function `init_display': tig.c:7113: undefined reference to
>> `set_tabsize'
>> >   collect2: ld returned 1 exit status
>> >   make: *** [tig] Error 1
>> >   %
>> >
>> > and bisected on
>> >
>> > commit f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d
>> > Author: Stefan Naewe <>
>> > Date:   Sun Sep 12 11:03:52 2010 +0200
>> >
>> >     Use function set_tabsize()
>> >
>> >     this fixes the following compile error on cygwin:
>> >     tig.c: In function `init_display':
>> >     tig.c:7112: error: invalid lvalue in assignment
>>
>> That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6
>>
>> Maybe you should say something about your system/OS version ?
>
> Naturally. I'm running on Gentoo.

One possibility is to add a check to configure, but I don't know if
you are even using that. Alternatively, I think it would also be safe
to simply just delete the line in question, since tig expands all tabs
to strings since quite a few releases.

-- 
Jonas Fonseca

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

* Re: [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 20:43   ` [tig] " Nicolas Sebrecht
  2010-09-20 21:48     ` Jonas Fonseca
@ 2010-09-20 23:05     ` Kumar Appaiah
  2010-09-20 23:13       ` Kumar Appaiah
  1 sibling, 1 reply; 9+ messages in thread
From: Kumar Appaiah @ 2010-09-20 23:05 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: Stefan Näwe, git

On Mon, Sep 20, 2010 at 10:43:44PM +0200, Nicolas Sebrecht wrote:
> > That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6
> > 
> > Maybe you should say something about your system/OS version ?
> 
> Naturally. I'm running on Gentoo.
> 

Ack that this also breaks build on CentOS. The simple reason is that
the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
Lenny is 5.7+. According to the changelog, 5.6 onwards has
set_tabsize, so checking for that version of ncurses might be a good
option.

Thanks.

Kumar

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

* Re: [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 23:05     ` Kumar Appaiah
@ 2010-09-20 23:13       ` Kumar Appaiah
  2010-09-21  6:37         ` Stefan Naewe
  2010-09-21 17:34         ` Nicolas Sebrecht
  0 siblings, 2 replies; 9+ messages in thread
From: Kumar Appaiah @ 2010-09-20 23:13 UTC (permalink / raw)
  To: git; +Cc: Nicolas Sebrecht, Stefan Näwe, fonseca

On Mon, Sep 20, 2010 at 06:05:59PM -0500, Kumar Appaiah wrote:
> On Mon, Sep 20, 2010 at 10:43:44PM +0200, Nicolas Sebrecht wrote:
> > > That change works for me on Cygwin, Ubuntu 10.04, Debian 5.0.6
> > > 
> > > Maybe you should say something about your system/OS version ?
> > 
> > Naturally. I'm running on Gentoo.
> > 
> 
> Ack that this also breaks build on CentOS. The simple reason is that
> the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
> Lenny is 5.7+. According to the changelog, 5.6 onwards has
> set_tabsize, so checking for that version of ncurses might be a good
> option.

I have attached a patch which uses the patch number to determine this:


HTH, Thanks!

Kumar

>From d10b7f15160b7d8da74f899f25018591cb33eec0 Mon Sep 17 00:00:00 2001
From: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Date: Mon, 20 Sep 2010 18:10:11 -0500
Subject: [PATCH] Check the ncurse version before using set_tabsize

This patch checks the ncurses patch level to decide if set_tabsize is
to be used in place of the TABSIZE macro, for setting the tab size.
---
 tig.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tig.c b/tig.c
index 7bc5daa..01b55d7 100644
--- a/tig.c
+++ b/tig.c
@@ -7111,7 +7111,11 @@ init_display(void)
 	keypad(status_win, TRUE);
 	wbkgdset(status_win, get_line_attr(LINE_STATUS));
 
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119)
 	set_tabsize(opt_tab_size);
+#else
+	TABSIZE = opt_tab_size;
+#endif
 
 	term = getenv("XTERM_VERSION") ? NULL : getenv("COLORTERM");
 	if (term && !strcmp(term, "gnome-terminal")) {
-- 
1.7.2.3

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

* Re: [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 23:13       ` Kumar Appaiah
@ 2010-09-21  6:37         ` Stefan Naewe
  2010-09-21 12:57           ` Jonas Fonseca
  2010-09-21 17:34         ` Nicolas Sebrecht
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Naewe @ 2010-09-21  6:37 UTC (permalink / raw)
  To: git

Kumar Appaiah <a.kumar <at> alumni.iitm.ac.in> writes:

> 
> On Mon, Sep 20, 2010 at 06:05:59PM -0500, Kumar Appaiah wrote:
> > Ack that this also breaks build on CentOS. The simple reason is that
> > the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
> > Lenny is 5.7+. According to the changelog, 5.6 onwards has
> > set_tabsize, so checking for that version of ncurses might be a good
> > option.
> 
> I have attached a patch which uses the patch number to determine this:
> 

Good. Works for me on Debian 5.0.6 and Cygwin.

Regards,

Stefan

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

* Re: [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-21  6:37         ` Stefan Naewe
@ 2010-09-21 12:57           ` Jonas Fonseca
  0 siblings, 0 replies; 9+ messages in thread
From: Jonas Fonseca @ 2010-09-21 12:57 UTC (permalink / raw)
  To: Stefan Naewe; +Cc: git

On Tue, Sep 21, 2010 at 02:37, Stefan Naewe <stefan.naewe@googlemail.com> wrote:
> Kumar Appaiah <a.kumar <at> alumni.iitm.ac.in> writes:
>
>>
>> On Mon, Sep 20, 2010 at 06:05:59PM -0500, Kumar Appaiah wrote:
>> > Ack that this also breaks build on CentOS. The simple reason is that
>> > the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
>> > Lenny is 5.7+. According to the changelog, 5.6 onwards has
>> > set_tabsize, so checking for that version of ncurses might be a good
>> > option.
>>
>> I have attached a patch which uses the patch number to determine this:
>>
>
> Good. Works for me on Debian 5.0.6 and Cygwin.

Thanks both, patch applied.

-- 
Jonas Fonseca

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

* [tig] Re: compilation error: undefined reference to `set_tabsize'
  2010-09-20 23:13       ` Kumar Appaiah
  2010-09-21  6:37         ` Stefan Naewe
@ 2010-09-21 17:34         ` Nicolas Sebrecht
  1 sibling, 0 replies; 9+ messages in thread
From: Nicolas Sebrecht @ 2010-09-21 17:34 UTC (permalink / raw)
  To: Kumar Appaiah; +Cc: git, Nicolas Sebrecht, Stefan Näwe, fonseca

The 20/09/10, Kumar Appaiah wrote:
> On Mon, Sep 20, 2010 at 06:05:59PM -0500, Kumar Appaiah wrote:

> > Ack that this also breaks build on CentOS. The simple reason is that
> > the ncurses version on CentOS 5.5 is ncurses-5.5, while that on Debian
> > Lenny is 5.7+. According to the changelog, 5.6 onwards has
> > set_tabsize, so checking for that version of ncurses might be a good
> > option.
> 
> I have attached a patch which uses the patch number to determine this:

Thanks Kumar, it did it (with ncurses v5.6)! :-)

-- 
Nicolas Sebrecht

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

end of thread, other threads:[~2010-09-21 17:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20 17:42 [tig] compilation error: undefined reference to `set_tabsize' Nicolas Sebrecht
2010-09-20 18:36 ` Stefan Näwe
2010-09-20 20:43   ` [tig] " Nicolas Sebrecht
2010-09-20 21:48     ` Jonas Fonseca
2010-09-20 23:05     ` Kumar Appaiah
2010-09-20 23:13       ` Kumar Appaiah
2010-09-21  6:37         ` Stefan Naewe
2010-09-21 12:57           ` Jonas Fonseca
2010-09-21 17:34         ` Nicolas Sebrecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).