From: Konstantin K. <klk...@ns...> - 2001-06-27 15:26:52
|
Hi All ! GCC 2.8. In function substring line 4984 else { /* I thought I would need more operations here, but... * desc.dsc_length = p - (USHORT*) desc.dsc_addr } ________________ must be like else { /* I thought I would need more operations here, but... * desc.dsc_length = p - (UCHAR * ) (USHORT*) desc.dsc_addr } I think, becouse of UCHAR * p; -- Konstantin Kuznetsov, phD |
From: Claudio V. C. <cv...@us...> - 2001-06-28 09:22:05
|
> -----Original Message----- > From: fir...@li... > [mailto:fir...@li...]On Behalf Of > Konstantin Kuznetsov > Sent: Miércoles 27 de Junio de 2001 11:27 > but... * > desc.dsc_length = p - (UCHAR * ) (USHORT*) > desc.dsc_addr > > I think, becouse of UCHAR * p; Yes, I believe it's illegal to compare pointers to different data types. I didn't notice my mistake and the MSVC compiler is more forgiving than I want so it let the thing to compile and run happily. You don't need the two casts, Konstantin. It was a typo. It should be instead: desc.dsc_length = p - (UCHAR*) desc.dsc_address; Since dsc.h declares dsc_address already as UCHAR pointer, we can avoid the cast altogether if you want. C. |
From: Konstantin K. <klk...@ns...> - 2001-06-28 12:16:21
|
Hi All! > > desc.dsc_length = p - (UCHAR * ) (USHORT*) > > desc.dsc_addr > > > > I think, becouse of UCHAR * p; > > Yes, I believe it's illegal to compare pointers to different data types. I > didn't notice my mistake and the MSVC compiler is more forgiving than I want > so it let the thing to compile and run happily. You don't need the two > casts, Konstantin. It was a typo. It should be instead: > > desc.dsc_length = p - (UCHAR*) desc.dsc_address; > > Since dsc.h declares dsc_address already as UCHAR pointer, we can avoid the > cast altogether if you want. Yes I believe, that pointer arifmetsics is not good thing and its must be the same type both. Please commit that. I just truing to build my new bynaries Konstantin |