On Thu, 2014-02-20 at 02:03 +0100, Lennart Poettering wrote: > On Thu, 20.02.14 01:21, Uoti Urpala (uoti.urp...@pp1.inet.fi) wrote: > > Even if there can be reasonable style disagreements about exactly where > > to use mixed declarations, at least some uses of them are certainly > > beneficial. It's only a matter of getting used to reading them if you've > > only read old-style code before. I'm sure that if C had had mixed > > declarations from the beginning, nobody would come up with a coding > > style which declared that particular feature to be harmful. > > > > Given systemd's approach to features, I think it's pretty ironic if its > > coding style has a "you can't expect me to get used to new features" > > attitude to something that's been used for more than a decade. > > Oh, it's really not like that. We make use of a lot of newer language > features all the time. We have have a lot of gccisms in our code, such > as the gcc cleanup attribute. And there's already C11 bits in the code, > too.
I know that some other new features are used. However, I don't believe that the underlying reason behind opposing mixed declarations would be anything other than being used to lack of it and opposing change. > However, there are certain language features that we consider > obvious improvements and there are others where we are a lot more > conservative. > > It's a matter of taste I figure, it's like tabs vs. spaces. We don't > allow tabs either in our sources... And neither do we allow declaration > after statements... For indentation style, you have to pick _something_ anyway. But you don't have to randomly forbid some normal language features, and the only reason for people to have such a "taste" is being used to old-style sources. There is no reason why people would pick out mixed declarations in particular as something to oppose if it was not a newer feature. If C had had mixed declarations from the beginning, but not the "->" operator, we might have people who are fine mixed declarations but insist that people write (*p).x instead of p->x. Nobody has such a taste now when they haven't become familiar with sources using only such style. > We are apparently not alone on this btw, after all gcc *does* have this > warning flag support even in C99 and C11 mode... Yes, there are people who still want to avoid that. I think they're quite similar to the people who insist that systemd must be only harmful as sysvinit has worked fine for them 20+ years. That's the reason for my comment about irony above. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel