Em Qua, 2007-10-10 às 00:18 -0400, Michael Krufky escreveu:Yes, it is. CodingStyle states: "Don't put multiple statements on a single line unless you have something to hide" and "Don't put multiple assignments on a single line either. Kernel coding style is super simple. Avoid tricky expressions." So, Kernel's script/checkpatch.pl is right when complaining about it. Yes, this is a great C feature, especially to obfuscate a source code. On C, it is possible to write very complex code, with several statements, on a single clause, like: if((c=(a=x,x-=c,++a)>6?1:-1)>0)goto foo; The above code is valid under C, and won't produce a single compiler warning. An experienced C programmer will understand the above code, while non-experienced ones, even with large experience on other programming languages, may take hours to understand. A large code, with lots of the above style will be very painful to analyze, even for advanced programmers. So, especially on big projects, with lots of contributors, this should really be avoided. It is just a matter of a simple CodingStyle fix. The proper fix is just to replace the offended code by this: err=foo(); if (error) goto error; -- Cheers, Mauro -
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Justin C. Sherrill | Re: pkgsrc bulk build and tiff |
| Jeremy Allison | Re: [RFC] Heads up on sys_fallocate() |
| Roland Dreier | Re: Integration of SCST in the mainstream Linux kernel |
| Matt Thomas | Re: Add a MAP_ALIGNED flag for mmap(2). |
| Vsevolod Stakhov | Unicode support in iso9660. |
| Jaromir Dolecek | Re: Speeding up fork/wait path |
| matthew green | re: merge of freebsd eventhandler |
git: | |
| Petr Janda | KDE and OpenSSL = Broken |
| sam | Re: Loader not found |
| Erick Perez | Re: dragonfly pdf documentation |
| Michel Talon | Re: Compatability with FreeBSD Ports [debian package tools] |
