cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 4c697d5087e5f5aaa01bada73396058eed88525d
parent 2b95bd2fe11ac8e982fc88d42661bd5cf3f6e475
Author: Michael Forney <mforney@mforney.org>
Date:   Fri,  5 Apr 2019 20:02:26 -0700

arg: Use (void *)0 instead of NULL in error case of conditional expression

Even though NULL is a null pointer constant, the comma expression with
NULL at the end is not. So, we must ensure that either the type of the
comma expression is `char *` or `void *`, and we don't know this for NULL.

Diffstat:
Marg.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arg.h b/arg.h @@ -15,4 +15,4 @@ } #define EARGF(x) \ - (done_ = 1, *++opt_ ? opt_ : argv[1] ? --argc, *++argv : ((x), abort(), NULL)) + (done_ = 1, *++opt_ ? opt_ : argv[1] ? --argc, *++argv : ((x), abort(), (void *)0))