If I don't use a function's return value, I cast it to void to say "I know this function returns something but I don't want to use it". I'm not sure were I picked up this habit, but I think it is fairly common. Some compilers will give a warning if you don't perform the cast, although gcc does not appear to.
Here are some of the places I've found this construct in the 2.6.11 sources: arch/i386/kernel/apm.c (line 924) arch/i386/mach-voyager/voyager_smp.c (line 1606) crypto/tcrypt.c (line 547) drivers/acpi/events/evxface.c (line 95) On Thu, 12 May 2005, Tom Duffy wrote: tduffy> On Thu, 2005-05-12 at 17:31 -0400, James Lentini wrote: tduffy> > I've changed the above line to tduffy> > tduffy> > (void) ib_send_cm_dreq(conn->cm_id, NULL, 0); tduffy> tduffy> Is there a reason for the leading (void)? tduffy> tduffy> -tduffy tduffy> _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
