From yosef at astro.rit.edu Wed Aug 20 14:14:13 2008 From: yosef at astro.rit.edu (Yosef Zlochower) Date: Wed, 20 Aug 2008 15:14:13 -0400 Subject: [Developers] Function prototype mismatch? Message-ID: <48AC6D05.8050301@astro.rit.edu> Hi, In Cactus/src/main/ScheduleInterface.c line 1267 CCTKi_DoScheduleTraverse(where, (int (*)(void *, void *)) CCTKi_ScheduleCallEntry, (int (*)(void *, void *)) CCTKi_ScheduleCallExit, (int (*)(int, char **, void *, void *, int)) CCTKi_ScheduleCallWhile, (int (*)(int, char **, void *, void *)) CCTKi_ScheduleCallIf, (int (*)(void *, void *, void *)) calling_function, (void *)&data); it seems that CCTKi_ScheduleCallI is being recast into a pointer to function of the the wrong type. According to the function prototype that argument should be of the type (int (*)(int, char **, void *, void *, int)) Yosef From schnetter at cct.lsu.edu Wed Aug 20 14:30:42 2008 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Wed, 20 Aug 2008 14:30:42 -0500 Subject: [Developers] Function prototype mismatch? In-Reply-To: <48AC6D05.8050301@astro.rit.edu> References: <48AC6D05.8050301@astro.rit.edu> Message-ID: On Aug 20, 2008, at 14:14:13, Yosef Zlochower wrote: > > Hi, > > In Cactus/src/main/ScheduleInterface.c line 1267 > > CCTKi_DoScheduleTraverse(where, > (int (*)(void *, void *)) > CCTKi_ScheduleCallEntry, > (int (*)(void *, void *)) > CCTKi_ScheduleCallExit, > (int (*)(int, char **, void *, void *, int)) > CCTKi_ScheduleCallWhile, > (int (*)(int, char **, void *, void *)) > CCTKi_ScheduleCallIf, > (int (*)(void *, void *, void *)) calling_function, > (void *)&data); > > it seems that CCTKi_ScheduleCallI is being recast into a pointer to > function of the the wrong type. According to the function prototype > that argument should be of the type > (int (*)(int, char **, void *, void *, int)) Yosef, thanks for pointing this out. This call is actually correct; the function CCTKi_ScheduleCallIf is wrong, it should not accept the last argument. The last argument makes only sense for while statements, not for if statements. I will commit a patch soon. -erik -- Erik Schnetter http://www.cct.lsu.edu/~eschnett/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://www.cactuscode.org/pipermail/developers/attachments/20080820/da34259e/attachment.bin