[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix pointer comparison
From: |
Bruno Haible |
Subject: |
Re: [PATCH] Fix pointer comparison |
Date: |
Sun, 03 Mar 2019 19:45:11 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) |
Hi Michal,
> it may make one think that the pointer is an int.
> Use explicit comparison against NULL (or !ptr).
I agree with you. Use of '0' to designate a NULL pointer is confusing
to most of us.
> lib/alloca.c | 10 +++++-----
> tests/test-tsearch.c | 2 +-
Applied.
> lib/getloadavg.c | 12 ++++++------
Here I preferred to write NULL instead of the boolean negation operator.
> lib/backup-find.c | 2 +-
> lib/obstack.c | 10 +++++-----
> lib/obstack.h | 2 +-
> tests/test-regex.c | 2 +-
Paul may want to handle these.
> lib/bitset/list.c | 2 +-
> lib/bitset/table.c | 2 +-
> lib/timevar.c | 2 +-
Akim may want to handle these.
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] Fix pointer comparison,
Bruno Haible <=