On Mon, 2014-12-15 at 14:59 +0300, Dan Carpenter wrote:
> I prefer !foo because it is more common in the kernel and I think it's
> easier to read but I don't feel strongly about this.
Me too. But I do prefer consistency.
fyi: for variants of:
"if (!foo)"
vs
"if (foo == NULL)"
Dan,
On Mon, Dec 15, 2014 at 04:43:34PM +0300, Dan Carpenter wrote:
> On Mon, Dec 15, 2014 at 05:03:46AM -0800, Jeremiah Mahler wrote:
> >
> > Or another way mentioned in K that produces a compile error
> >
> > if (NULL = x)
> >
>
> Yes. People used to write Yoda code back in
On Mon, Dec 15, 2014 at 05:03:46AM -0800, Jeremiah Mahler wrote:
>
> Or another way mentioned in K that produces a compile error
>
> if (NULL = x)
>
Yes. People used to write Yoda code back in the day. Don't ever do
this in the kernel.
1) It looks stupid.
2) GCC will catch most
On Mon, Dec 15, 2014 at 11:44:21AM +, One Thousand Gnomes wrote:
> On Sat, 13 Dec 2014 11:46:47 -0800
> Jeremiah Mahler wrote:
>
> > Loïc,
> >
> > On Sat, Dec 13, 2014 at 07:22:38PM +0100, Loic Pefferkorn wrote:
> > > > Whose convention is this? I can't find any mention in
> > > >
I haven't seen any bugs caused by lack of type safety with "!foo"...
I prefer !foo because it is more common in the kernel and I think it's
easier to read but I don't feel strongly about this.
I kind of hate "if (foo != NULL) though, because it's a double negative.
But I really hate when people
On Sat, 13 Dec 2014 11:46:47 -0800
Jeremiah Mahler wrote:
> Loïc,
>
> On Sat, Dec 13, 2014 at 07:22:38PM +0100, Loic Pefferkorn wrote:
> > > Whose convention is this? I can't find any mention in
> > > Documention/CodingStyle. checkpatch.pl doesn't complain about them.
> > > And there are
On Sat, 13 Dec 2014 11:46:47 -0800
Jeremiah Mahler jmmah...@gmail.com wrote:
Loïc,
On Sat, Dec 13, 2014 at 07:22:38PM +0100, Loic Pefferkorn wrote:
Whose convention is this? I can't find any mention in
Documention/CodingStyle. checkpatch.pl doesn't complain about them.
And there are
I haven't seen any bugs caused by lack of type safety with !foo...
I prefer !foo because it is more common in the kernel and I think it's
easier to read but I don't feel strongly about this.
I kind of hate if (foo != NULL) though, because it's a double negative.
But I really hate when people
On Mon, Dec 15, 2014 at 11:44:21AM +, One Thousand Gnomes wrote:
On Sat, 13 Dec 2014 11:46:47 -0800
Jeremiah Mahler jmmah...@gmail.com wrote:
Loïc,
On Sat, Dec 13, 2014 at 07:22:38PM +0100, Loic Pefferkorn wrote:
Whose convention is this? I can't find any mention in
On Mon, Dec 15, 2014 at 05:03:46AM -0800, Jeremiah Mahler wrote:
Or another way mentioned in KR that produces a compile error
if (NULL = x)
Yes. People used to write Yoda code back in the day. Don't ever do
this in the kernel.
1) It looks stupid.
2) GCC will catch most ==
Dan,
On Mon, Dec 15, 2014 at 04:43:34PM +0300, Dan Carpenter wrote:
On Mon, Dec 15, 2014 at 05:03:46AM -0800, Jeremiah Mahler wrote:
Or another way mentioned in KR that produces a compile error
if (NULL = x)
Yes. People used to write Yoda code back in the day.
On Mon, 2014-12-15 at 14:59 +0300, Dan Carpenter wrote:
I prefer !foo because it is more common in the kernel and I think it's
easier to read but I don't feel strongly about this.
Me too. But I do prefer consistency.
fyi: for variants of:
if (!foo)
vs
if (foo == NULL)
a
12 matches
Mail list logo