Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!JAN.ULTRA.NYU.EDU!edler From: edler@JAN.ULTRA.NYU.EDU (Jan Edler) Newsgroups: gnu.gcc.bug Subject: -Wcast-qual bug? Message-ID: <9001041754.AA00548@jan.ultra.nyu.edu> Date: 4 Jan 90 17:54:16 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 26 Consider the following example, compiled with -Wcast-qual: int g(int *x, int *y) { return *x + *y; } int f() { static int foo; const int bar; return g(&foo, &bar); } The compiler says x.c: In function f: x.c:12: warning: pointer to const given for argument 1 of `g' I claim the argument number given in the warning is off by one. I suppose you might feel that arguments are "naturally" zero-origin, but I wasted 10 minutes on a real case because I assumed argument 3 was the third argument to a function. Jan Edler