Re: Don't return void types from void functions.

Denis Vlasenko
2004-05-26T08:45:40Z

On Wednesday 26 May 2004 09:28, Jeff Garzik wrote:
> Linux Kernel Mailing List wrote:
> > diff -Nru a/drivers/net/tokenring/olympic.c
> > b/drivers/net/tokenring/olympic.c ---
> > a/drivers/net/tokenring/olympic.c 2004-05-25 23:06:49 -07:00 +++
> > b/drivers/net/tokenring/olympic.c 2004-05-25 23:06:49 -07:00 @@ -1806,7
> > +1806,7 @@
> >
> > static void __exit olympic_pci_cleanup(void)
> > {
> > - return pci_unregister_driver(&olympic_driver) ;
> > + pci_unregister_driver(&olympic_driver) ;
> > }
>
> Can we make gcc error out when it finds this?

AFAIK new C++ standard allows this syntax.

typedef int opaque;

opaque f();
opaque g() { return f(); }

Now imagine we need to change
-typedef int opaque;
+typedef void opaque;
--
vda