🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1228

Why does this need a cast?

#1228
From: roger reynolds
Date: Mon, 28 Sep 1992 21:07
26 lines
1294 bytes
	I am just getting it together as far as switching over to
	ANSI C, and am having a small problem, which I believe is 	
	a bug in gcc, though maybe I am just doing something wrong:
	I am using gcc version 2.2.2

	Here is a function definition:

XtEventHandler
dbSelectRecord(Widget w, FormRecPtr f, XButtonEvent *ev, Boolean *flag)
{
	...
}

	and later on in the same source file, I call XtAddEventHandler as :

XtAddEventHandler (f->selectionText, ButtonPressMask, 
                   FALSE, dbSelectRecord, f);

	My confusion is that I get a warning saying that dbSelectRecord
	is not the right kind of arg for this function.  If I cast it
	to (XtEventHandler)dbSelectRecord,  then all is fine.

	Seems to me like this ain't right.
	Any comments would be quite appreciated,

	rogerr@netcom.com
Technical Details
Message-ID: <nz_ptn#.rogerr@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!netcom.com!rogerr

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!netcom.com!rogerr
From: rogerr@netcom.com (roger reynolds)
Subject: Why does this need a cast?
Message-ID: <nz_ptn#.rogerr@netcom.com>
Followup-To: poster
Sender: gnulists@ai.mit.edu
Organization: Netcom - Online Communication Services  (408 241-9760 guest)
Distribution: gnu
Date: Mon, 28 Sep 1992 21:07:10 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 29