Re: problems creating a driver

From: David Gómez (david@pleyades.net)
Date: Sun Dec 15 2002 - 10:49:44 EST


Hi David ;);

> totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
> totcl.cc:60: cannot convert `int (*) (inode *, file *)' to `ssize_t (*)
> (file *, char *, unsigned int, loff_t *)' in initialization
> make: *** [totcl.ko] Error 1

I think the problem it's that designated initializers are not implemented in
the GNU c++ compiler, so you have to initialize all the field in the structure.

> my file_operations var is:
> struct file_operations totcl_fops=
> {
> read:totcl_read,
> open:totcl_open,
> release:totcl_release,
> };

By the way, C99 syntax is better, most of the kernel has been changed to the
new syntax:

struct file_operations totcl_fops=
{
    .read=totcl_read,
    .open=totcl_open,
    .release=toctl_release,
};

--
David Gómez

"The question of whether computers can think is just like the question of whether submarines can swim." -- Edsger W. Dijkstra - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:33 EST