Compiling on (old?) Solaris produces "subscripted value is neither array nor pointer" #97

Closed
samej71 opened this Issue Oct 22, 2012 · 6 comments

Comments

Projects
None yet
2 participants
@samej71

samej71 commented Oct 22, 2012

Please forgive me if I fail to include the proper/necessary information

I am attempting to compile and install tig on a Solaris system of my employer for personal use/experimentation (under my home directory, not installed as root into system directories). I have installed the latest ncurses with wide character support enabled and libiconv libraries.

./configure generated this output:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for NcursesW wide-character library... yes
checking for working ncursesw/curses.h... no
checking for working ncursesw.h... no
checking for working ncurses.h... yes
checking for iconv... yes
checking for iconv declaration...
extern size_t iconv (iconv_t cd, const char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for asciidoc... asciidoc
checking for xmlto... no
checking for docbook2pdf... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating config.h

and make generated this output:

In file included from tig.c:14:
tig.h:81:1: warning: "__NORETURN" redefined
In file included from /usr/include/sys/feature_tests.h:11,
from /usr/include/iso/ctype_iso.h:30,
from /usr/include/ctype.h:18,
from tig.h:38,
from tig.c:14:
/usr/include/sys/ccompile.h:97:1: warning: this is the location of the previous definition
tig.c: In function toggle_option': tig.c:2468: error: subscripted value is neither array nor pointer tig.c:2468: error: subscripted value is neither array nor pointer tig.c:2468: error: subscripted value is neither array nor pointer tig.c:2468: error: subscripted value is neither array nor pointer tig.c:2468: error: subscripted value is neither array nor pointer tig.c: In functionreport':
tig.c:7521: warning: passing arg 2 of `vwprintw' discards qualifiers from pointer target type

I've tried to research this on the internet, and found this thread:

http://old.nabble.com/UPDATE%3A-tig-td31357647.html#a31376777

but unfortunately I'm not sure what the proper remedy is, even though the participants in that thread seem to have updated something and got it to compile properly.

Any assistance is appreciated. Thanks!

--James

@jonas

This comment has been minimized.

Show comment Hide comment
@jonas

jonas Oct 22, 2012

Owner

Could you try to update to commit 9ba6219 and see if that fixes your problems?
I was not able to find a fix for the last warning.

Owner

jonas commented Oct 22, 2012

Could you try to update to commit 9ba6219 and see if that fixes your problems?
I was not able to find a fix for the last warning.

@samej71

This comment has been minimized.

Show comment Hide comment
@samej71

samej71 Oct 22, 2012

Thank you very much for you very prompt replies. But I apologize: you've
exceeded my unix/C experience. :)

I cloned your repo and checked out 9ba6219. I naively tried to run
./configure but is not present in my cloned working directory. I then went
to my tig-1.1 directory and simply copied over all the files from the
working directory in the hopes then that I could compile 9ba6219 in the
shell of the tig-1.1 directory.

I ran configure, output seemed same as before. But when I run make I get:

./autogen.sh
./autogen.sh: WARNINGS=all: is not an identifier
make: *** [configure] Error 1

I assume it is because I don't know what I'm doing.

Please advise. :)

--James

On Mon, Oct 22, 2012 at 1:44 PM, Jonas Fonseca notifications@github.comwrote:

Could you try to update to commit 9ba62199ba6219 see if that fixes your problems?
I was not able to find a fix for the last warning.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9675527.

samej71 commented Oct 22, 2012

Thank you very much for you very prompt replies. But I apologize: you've
exceeded my unix/C experience. :)

I cloned your repo and checked out 9ba6219. I naively tried to run
./configure but is not present in my cloned working directory. I then went
to my tig-1.1 directory and simply copied over all the files from the
working directory in the hopes then that I could compile 9ba6219 in the
shell of the tig-1.1 directory.

I ran configure, output seemed same as before. But when I run make I get:

./autogen.sh
./autogen.sh: WARNINGS=all: is not an identifier
make: *** [configure] Error 1

I assume it is because I don't know what I'm doing.

Please advise. :)

--James

On Mon, Oct 22, 2012 at 1:44 PM, Jonas Fonseca notifications@github.comwrote:

Could you try to update to commit 9ba62199ba6219 see if that fixes your problems?
I was not able to find a fix for the last warning.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9675527.

@jonas

This comment has been minimized.

Show comment Hide comment
@jonas

jonas Oct 22, 2012

Owner

The simplest would be to start with the files from the tig-1.1 tarball and then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied all files you triggered make to try to rebuild the configure script, which you don't need to do.

Owner

jonas commented Oct 22, 2012

The simplest would be to start with the files from the tig-1.1 tarball and then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied all files you triggered make to try to rebuild the configure script, which you don't need to do.

@samej71

This comment has been minimized.

Show comment Hide comment
@samej71

samej71 Oct 22, 2012

Sounds good. Unfortunately, I cannot try it for a few hours. I will let you
know how it goes as soon as I can.

Thanks!

On Mon, Oct 22, 2012 at 4:30 PM, Jonas Fonseca notifications@github.comwrote:

The simplest would be to start with the files from the tig-1.1 tarball and
then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied
all files you triggered make to try to rebuild the configure script, which
you don't need to do.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9681463.

samej71 commented Oct 22, 2012

Sounds good. Unfortunately, I cannot try it for a few hours. I will let you
know how it goes as soon as I can.

Thanks!

On Mon, Oct 22, 2012 at 4:30 PM, Jonas Fonseca notifications@github.comwrote:

The simplest would be to start with the files from the tig-1.1 tarball and
then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied
all files you triggered make to try to rebuild the configure script, which
you don't need to do.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9681463.

@samej71

This comment has been minimized.

Show comment Hide comment
@samej71

samej71 Oct 23, 2012

I removed my tig-1.1 directory and extracted a fresh one from the tarball,
and copied over the .h and .c files from my local working directory into
it. I ran configure and make and got the same repeated error:

tig.c: In function `toggle_option':
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer

I verified that my tig.c matches the version in 9ba6219.

For grins, I changed (map != NULL ? ARRAY_SIZE(map) : 0) to just 0 to see
what the compiler would do. Probably no surprise to you, it compiled
appropriately, which confirms what you were trying to fix with
ARRAY_SIZE(map). Unfortunately, I'm not sure how to debug what the
value/type of "map" actually is in order to see why it is causing this
problem. If you have anything you'd like me to try, just let me know.

On Mon, Oct 22, 2012 at 4:36 PM, JamesML Olsen jamesml@planetolsen.comwrote:

Sounds good. Unfortunately, I cannot try it for a few hours. I will let
you know how it goes as soon as I can.

Thanks!

On Mon, Oct 22, 2012 at 4:30 PM, Jonas Fonseca notifications@github.comwrote:

The simplest would be to start with the files from the tig-1.1 tarball
and then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied
all files you triggered make to try to rebuild the configure script, which
you don't need to do.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9681463.

samej71 commented Oct 23, 2012

I removed my tig-1.1 directory and extracted a fresh one from the tarball,
and copied over the .h and .c files from my local working directory into
it. I ran configure and make and got the same repeated error:

tig.c: In function `toggle_option':
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer
tig.c:2468: error: subscripted value is neither array nor pointer

I verified that my tig.c matches the version in 9ba6219.

For grins, I changed (map != NULL ? ARRAY_SIZE(map) : 0) to just 0 to see
what the compiler would do. Probably no surprise to you, it compiled
appropriately, which confirms what you were trying to fix with
ARRAY_SIZE(map). Unfortunately, I'm not sure how to debug what the
value/type of "map" actually is in order to see why it is causing this
problem. If you have anything you'd like me to try, just let me know.

On Mon, Oct 22, 2012 at 4:36 PM, JamesML Olsen jamesml@planetolsen.comwrote:

Sounds good. Unfortunately, I cannot try it for a few hours. I will let
you know how it goes as soon as I can.

Thanks!

On Mon, Oct 22, 2012 at 4:30 PM, Jonas Fonseca notifications@github.comwrote:

The simplest would be to start with the files from the tig-1.1 tarball
and then only copy the .c and .h files. Something like:

$ cp /path/to/tig/git/repository/*.[ch] /path/to/tig-1.1/files/

I will fix the above error in the shell script. However, since you copied
all files you triggered make to try to rebuild the configure script, which
you don't need to do.


Reply to this email directly or view it on GitHubhttps://github.com/jonas/tig/issues/97#issuecomment-9681463.

@jonas

This comment has been minimized.

Show comment Hide comment
@jonas

jonas Aug 26, 2013

Owner

I believe this has been fixed in commit 2b13047 which rewrote the macro code in toggle_option.

Owner

jonas commented Aug 26, 2013

I believe this has been fixed in commit 2b13047 which rewrote the macro code in toggle_option.

@jonas jonas closed this Aug 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment