[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [Highwire] gcc4



On Sun, 05 Sep 2010 19:55:26 , m0n0 <ole@monochrom.net> wrote:
>
> Am Sonntag, den 05.09.2010, 14:41 +0200 schrieb Peter Slegg
> <p.slegg@scubadivers.co.uk>:
>
> > static BOOL
> > decGif_read (IMGINFO info, CHAR buffer)
> > {
> >     GifPixelType *pixelType = buffer;   <<<<<<<<<
> >     return (DGifGetLine (info->_priv_data, pixelType, info->ImgWidth)
> > == GIF_OK);
> > }
> >
> > The line indicated gives:
> >
> > img_gif.c: In function 'decGif_read':
> > img_gif.c:115:28: error: initialization makes pointer from integer
> > without a cast
>
> did you try:
>
> GifPixelType *pixelType = (GifPixelType *)buffer;
>
> ?
>

I have just "fixed" them by making more use of CHAR*  in the function
interface.

I have just hit these which I am not familiar with:

error: cast discards qualifiers from pointer target type

something to do with volatiles.

I have just tried compiling without -Wall as an experiment and it fails
with a real error with the last, nasty line here:

const GS_INFO *sender;
                short answ[8], *p_answ = answ;
                long *gsi_ = (long *)gsi;

                *p_answ++              /*[0]*/ = GS_REPLY;
                *p_answ++              /*[1]*/ = gl_apid;
                *p_answ++              /*[2]*/ = 0;
                *((long **)p_answ)++/*[3..4]*/ = gsi_;

AEI.c: In function 'process_messages':
AEI.c:1555:5: error: lvalue required as increment operand
AEI.c:1559:5: error: lvalue required as increment operand

It's trying to asign a value to something that has been ++ incremented
so is itself a value. Not good. Should it be split into two
lines and values assigned to p_answ 3 and 4 or just 4 ?

Peter