OT: typesafe callbacks in C (Re: [WIP PATCH 1/7] Add skeleton RA svnclient)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Shahaf wrote:

> By the way, a common pitfall is to mis-treat the void *baton argument as
> the wrong type of baton.  That is, code of the form
> 
>     f(void *baton) {
>         foo_baton_t *fb = baton;
>     }
> 
> instead of
> 
>     f(void *baton) {
>         bar_baton_t *bb = baton;
>     }

Just for kicks, I should mention

  http://ccan.ozlabs.org/info/typesafe_cb.html

which makes code like this cause warnings with gcc.

Maybe some version of Subversion years from now could use it.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]