Operating System - HP-UX
1854671 Members
2538 Online
104102 Solutions
New Discussion

Re: gmake warning: subscript has type `char' in shc

 
Martin MABIKA
Occasional Contributor

gmake warning: subscript has type `char' in shc

Dear all,

I have compilation problem at hpux 11.0 gcc-3.4.2

/sauve/SHC/GNU64/pa20_64/bin/gcc -Wall -O6 -pedantic shc.c -o shc

shc.c: In function `noise':
shc.c:742: warning: subscript has type `char'

Any idea . Thanks in advance.

Martin
mmabika
2 REPLIES 2
Muthukumar_5
Honored Contributor

Re: gmake warning: subscript has type `char' in shc

what is there in shc.c files 742??

sed -n 745,750p shc.c

It will be helpful to identify cause for warning there.
Easy to suggest when don't know about the problem!
Martin MABIKA
Occasional Contributor

Re: gmake warning: subscript has type `char' in shc

742 is line number as defined here:

735 int noise(char * ptr, unsigned min, unsigned xtra, int str)
736 {
737 if (xtra) xtra = rand() % xtra;
738 xtra += min;
739 for (min = 0; min < xtra; min++, ptr++)
740 do
741 *ptr = (char) rand();
742 while (str && !isalnum(*ptr));
743 if (str) *ptr = '\0';
744 return xtra;
745 }

Is any one has already compiled shc in hp 11.0 plateforme ? I have got a corresponding depot file but it is not worked

Thanks in advance.

Martin
mmabika