Re: problems creating a driver

David Gómez (david@pleyades.net)
Sun, 15 Dec 2002 16:49:44 +0100


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/