[PATCH:xdm 1/2] Add a cast to avoid a compiler error.

Geert Uytterhoeven geert at linux-m68k.org
Fri Jun 28 12:00:51 PDT 2013


On Fri, Jun 28, 2013 at 7:35 PM, Thomas Klausner <wiz at netbsd.org> wrote:
> -       if (atomicio(write, fd, msg, sizeof(msg)) != sizeof(msg)) {
> +       if (atomicio((ssize_t (*)(int, void *, size_t))write, fd, msg, sizeof(msg)) != sizeof(msg)) {

This cast looks really gross to me...

What about wrapping write() in a function that takes care of casting the second
parameter of the function?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


More information about the xorg-devel mailing list