X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Sat, 02 Feb 2002 15:50:05 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Philip Pemberton" Message-Id: <1190-Sat02Feb2002155004+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (philpem@bigfoot.com) Subject: Re: Help: warning: passing arg ... of ... discards qualifiers from pointer target type References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Philip Pemberton" > Newsgroups: comp.os.msdos.djgpp > Date: Sat, 2 Feb 2002 11:49:48 -0000 > > gcc -Wall -O3 -m486 -c -o mpf.o mpf.c > mpf.c: In function `drawLEDSeg': > mpf.c:61: warning: passing arg 3 of `polygon' discards qualifiers from > pointer target type > [...] > Someone care to explain this? I've managed to create a short program that > demonstrates this. > > Compiler cmdline: > gcc -o temp.exe temp.c -lalleg > > ---8<---CUT HERE---8<--- TEMP.C > #include "allegro.h" > #include "conio.h" > > const int points[12] = {1,2,3,4,5,6,7,8,9,10,11,12}; > > int main() > { > allegro_init(); > polygon(screen, 6, points, 15); > getch(); It removes the `const' qualifier from `points' due to prototype. Look at the prototype of `polygon': I'm guessing that its 3rd argument's type is `int[]' or `int *'. But you pass a `const int []' instead, so the compiler tells you that `polygon' might change its 3rd argument--beware!