Hi, The compilers warns you that you state (with const) your struct is not allowed to be modified, but the DrawBitmap function apparently is defined taking that parameter without 'const', hence not agreeing it won't change the struct content. If the DrawBitmap function is yours and it does not modify this parameter, the best way to remove the warning is making the 5th parameter const. Casting is okay too, since it shows you checked and found it is okay. I would not recommend ignoring this (or any other) warning. Joep Op za 15 sep. 2018 om 18:11 schreef Neil : > Hi all, > > I've got bitmaps defined using const (to store it in program memory) in > my PIC32 code as... > const unsigned char Logo1Bitmap[312] =3D > { > 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xF0, > 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, > ... > } > > > I also have this function... > void DrawBitmap(signed short XPos, signed short YPos, signed short > width, signed short height, unsigned char *bitmap, unsigned short color); > > > When I pass the bitmap to the function like this... > DrawBitmap(85, 28, 52, 42, Logo1Bitmap, 0x7BEF); > > > I get warning messages like this... > warning: passing argument 5 of 'DrawBitmap' discards 'const' qualifier > from pointer target type [enabled by default] > DrawBitmap(85, 28, 52, 42, Logo1Bitmap, 0x7BEF); > > The only way I can get the warning to go away is to do this... > DrawBitmap(85, 28, 52, 42, (unsigned char *)&Logo1Bitmap[0], > 0x7BEF); > > > It works properly either way, but I'm unclear what it thinks I'm doing > wrong. And what's the right way to do this? > > Cheers, > -Neil. > > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .