From: Ricardo J. N. da S. <ja...@at...> - 2003-07-17 12:33:00
|
I´ve saved your code in k.c file. I´ve just add a comment do the '^' line and it has compiled succesfully without warnings. I´m using sdcc 2.3.0 sdcc k.c bye. //----------------------------- unsigned char array[4]; void main() { while(1) { if(--array[2] <5) array[2]=45; // ^ <----------------here if(++array[3]>23) array[3]=0; ^ //<-----------------& here! } } //-------------------------------- > Hi all, > I dont know if this is a bug...I think this code is ok...Please see > below: > > //----------------------------- > unsigned char array[4]; > > void main() > { > while(1) > { > if(--array[2] <5) array[2]=45; > // ^ <----------------here > > if(++array[3]>23) array[3]=0; > ^ //<-----------------& here! > } > } > //-------------------------------- > I get these warnings:- > hrs6.c:32: warning: converting integral to pointer without a cast from > type 'literal-unsigned-char' to type 'unsigned-char near* ' > hrs6.c:33: warning: converting integral to pointer without a cast from > type 'literal-unsigned-char' to type 'unsigned-char near* ' > > then I have to do this to get around it. > > --array[2]; > if(array[2] < 2) > array[2]=45; > > ---etc. > Same is the case for 2 dim arrays. > > Thanks, > --Royce. > > ------------------------------------------------------- > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user -- Ricardo Jardel N. da Silveira Electrical Engineer Phone: 55 85 216.7924 Mobile: 55 85 91167655 or 859...@bc... Fax: 55 85 216.7864 Address: Rua Chico Lemos , 946, Cidade dos Funcionários, City : Fortaleza State : Ceara Country : Brazil Postal Code : 60822 780 |