I promised:
>   - see how this new warning behaves on the Gnulib source code

The two good news are:
  - The warning is really helpful. With it, I could find all relevant uses of
    '0' quickly. Patch attached and committed.
  - There were no false positives.

However, there are warnings that are not in the responsibility of a package
maintainer:

  * Anywhere a pthread_mutex_t is initialized, the warning appears. This is
    because on glibc, the macro __PTHREAD_MUTEX_INITIALIZER(__kind)
    expands to
      0, 0, 0, 0, __kind, 0, 0, { 0, 0 }
    It should better expand to
      0, 0, 0, 0, __kind, 0, 0, { NULL, NULL }

  * gperf generated code has these warnings:
    unicase/special-casing-table.gperf:171:10: warning: zero as null pointer 
constant [-Wzero-as-null-pointer-constant]
    unictype/categ_byname.gperf:115:10: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
    unictype/incb_byname.gperf:60:10: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
    unictype/joininggroup_byname.gperf:131:10: warning: zero as null pointer 
constant [-Wzero-as-null-pointer-constant]
    unictype/pr_byname.gperf:114:10: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
    unictype/scripts_byname.gperf:160:10: warning: zero as null pointer 
constant [-Wzero-as-null-pointer-constant]
    uninorm/composition-table.gperf:995:10: warning: zero as null pointer 
constant [-Wzero-as-null-pointer-constant]

These can only be fixed with a new glibc release and a new gperf release.

So, as things stand now, we can recommend the warning option to package
maintainers. But I am not in favour of letting Gnulib enable it by default,
since it will invariably lead to warnings (in the two cases mentioned above)
that the maintainer cannot silence. Only once there have been glibc + gperf
releases and we have waited 2 years until most maintainers have a system with
these newer releases, will it make sense to enable it by default.

Bruno

 ------------------------------------------------------------------------------
The patch fixes the warnings:

argp-help.c:625:61: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1360:37: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1372:65: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1605:40: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1609:14: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1651:57: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1708:29: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1825:16: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-help.c:1860:41: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:80:33: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:81:33: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:86:13: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:142:33: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:143:13: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:335:41: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:411:45: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:540:64: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:589:75: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:593:69: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:632:61: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:643:69: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:650:56: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:689:58: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:802:75: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
argp-parse.c:806:70: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
backup-find.c:73:18: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:98:28: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:199:25: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:220:23: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:224:27: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:225:27: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:226:21: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:259:30: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:261:29: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:362:14: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:442:23: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:450:17: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:490:36: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:945:22: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/list.c:1255:21: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/stats.c:699:17: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:101:25: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:111:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:182:28: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:254:16: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:821:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:822:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:853:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:854:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:889:53: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:890:53: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:891:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:910:18: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:1153:23: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitset/table.c:1163:21: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
bitsetv.c:55:12: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
error.c:200:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
exclude.c:263:45: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
getopt.c:735:30: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
getopt.c:735:33: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
human.c:400:72: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
nap.h:101:35: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:121:15: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:164:38: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:229:16: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:234:16: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:250:16: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:265:19: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
obstack.c:276:29: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
quotearg.c:89:3: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
quotearg.c:258:30: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
quotearg.c:814:46: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
readutmp.c:335:26: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
savedir.c:90:5: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
settime.c:46:31: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-fts.c:32:38: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-fts.c:46:43: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-fts.c:47:74: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-fts.c:62:70: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-fts.c:138:78: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-getaddrinfo.c:85:37: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:74:56: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:108:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:112:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:115:10: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:115:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:121:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:125:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:131:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:135:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:137:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:191:7: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:283:62: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:317:40: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:326:47: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:337:49: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:347:21: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:372:71: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:405:68: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:413:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:428:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:443:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:458:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:472:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:491:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:497:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:503:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:509:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:515:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:521:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:527:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:533:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:548:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:554:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:560:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:566:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:572:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:578:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:584:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:598:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:614:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:620:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:626:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:632:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:638:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:644:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:650:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:656:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:662:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:668:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:683:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:689:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:695:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:701:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:707:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:714:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:722:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:728:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:734:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:748:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-nstrftime.h:756:48: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:151:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:161:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:171:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:182:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:192:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:203:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:213:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:224:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-parse-datetime.c:234:39: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-regex.c:244:50: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
test-regex.c:341:12: warning: zero as null pointer constant 
[-Wzero-as-null-pointer-constant]
>From abff3049b0324ddf3a86b667e311b3a5b27200a5 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 14 Nov 2024 15:56:50 +0100
Subject: [PATCH] Eliminate gcc -Wzero-as-null-pointer-constant warnings.

* lib/argp-help.c: Use NULL, not 0, to denote a null pointer.
* lib/argp-parse.c: Likewise.
* lib/backup-find.c (get_version): Likewise.
* lib/bitset/list.c: Likewise.
* lib/bitset/stats.c (bitset_stats_init): Likewise.
* lib/bitset/table.c: Likewise.
* lib/bitsetv.c (bitsetv_alloc): Likewise.
* lib/error.c (print_errno_message): Likewise.
* lib/exclude.c (new_exclude_segment): Likewise.
* lib/getopt.c (GETOPT_ENTRY): Likewise.
* lib/human.c (block_size_args): Likewise.
* lib/obstack.c (_obstack_begin_worker, _obstack_newchunk,
_obstack_allocated_p, _obstack_free, _obstack_memory_used): Likewise.
* lib/quotearg.c (quoting_style_args, quotearg_buffer_restyled,
quotearg_alloc_mem): Likewise.
* lib/readutmp.c (read_utmp_from_file): Likewise.
* lib/savedir.c (comparison_function_table): Likewise.
* lib/settime.c (settime): Likewise.
* tests/nap.h (nap_works): Likewise.
* tests/test-fts.c (argv, fts_dealloc, remove_tree, main): Likewise.
* tests/test-getaddrinfo.c (simple): Likewise.
* tests/test-nstrftime.h (posixtm_test, TZ, quarter_test, errno_test,
locales_test): Likewise.
* tests/test-parse-datetime.c (main): Likewise.
* tests/test-regex.c (main): Likewise.
---
 ChangeLog                   |  29 +++++++++
 lib/argp-help.c             |  18 +++---
 lib/argp-parse.c            |  32 +++++-----
 lib/backup-find.c           |   2 +-
 lib/bitset/list.c           |  28 ++++----
 lib/bitset/stats.c          |   2 +-
 lib/bitset/table.c          |  28 ++++----
 lib/bitsetv.c               |   2 +-
 lib/error.c                 |   2 +-
 lib/exclude.c               |   2 +-
 lib/getopt.c                |   2 +-
 lib/human.c                 |   2 +-
 lib/obstack.c               |  14 ++--
 lib/quotearg.c              |   6 +-
 lib/readutmp.c              |   2 +-
 lib/savedir.c               |   2 +-
 lib/settime.c               |   2 +-
 tests/nap.h                 |   2 +-
 tests/test-fts.c            |  11 ++--
 tests/test-getaddrinfo.c    |   2 +-
 tests/test-nstrftime.h      | 124 ++++++++++++++++++------------------
 tests/test-parse-datetime.c |  18 +++---
 tests/test-regex.c          |   4 +-
 23 files changed, 183 insertions(+), 153 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0dd535446d..da783e9f32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2024-11-14  Bruno Haible  <br...@clisp.org>
+
+	Eliminate gcc -Wzero-as-null-pointer-constant warnings.
+	* lib/argp-help.c: Use NULL, not 0, to denote a null pointer.
+	* lib/argp-parse.c: Likewise.
+	* lib/backup-find.c (get_version): Likewise.
+	* lib/bitset/list.c: Likewise.
+	* lib/bitset/stats.c (bitset_stats_init): Likewise.
+	* lib/bitset/table.c: Likewise.
+	* lib/bitsetv.c (bitsetv_alloc): Likewise.
+	* lib/error.c (print_errno_message): Likewise.
+	* lib/exclude.c (new_exclude_segment): Likewise.
+	* lib/getopt.c (GETOPT_ENTRY): Likewise.
+	* lib/human.c (block_size_args): Likewise.
+	* lib/obstack.c (_obstack_begin_worker, _obstack_newchunk,
+	_obstack_allocated_p, _obstack_free, _obstack_memory_used): Likewise.
+	* lib/quotearg.c (quoting_style_args, quotearg_buffer_restyled,
+	quotearg_alloc_mem): Likewise.
+	* lib/readutmp.c (read_utmp_from_file): Likewise.
+	* lib/savedir.c (comparison_function_table): Likewise.
+	* lib/settime.c (settime): Likewise.
+	* tests/nap.h (nap_works): Likewise.
+	* tests/test-fts.c (argv, fts_dealloc, remove_tree, main): Likewise.
+	* tests/test-getaddrinfo.c (simple): Likewise.
+	* tests/test-nstrftime.h (posixtm_test, TZ, quarter_test, errno_test,
+	locales_test): Likewise.
+	* tests/test-parse-datetime.c (main): Likewise.
+	* tests/test-regex.c (main): Likewise.
+
 2024-11-14  Bruno Haible  <br...@clisp.org>
 
 	ftruncate, ftello: Make them work again for large files on MSVC.
diff --git a/lib/argp-help.c b/lib/argp-help.c
index 9c7456642c..193fd384b7 100644
--- a/lib/argp-help.c
+++ b/lib/argp-help.c
@@ -622,7 +622,7 @@ static char
 hol_entry_first_short (const struct hol_entry *entry)
 {
   return hol_entry_short_iterate (entry, until_short,
-                                  entry->argp->argp_domain, 0);
+                                  entry->argp->argp_domain, NULL);
 }
 
 /* Returns the first valid long option in ENTRY, or NULL if there is none.  */
@@ -1357,7 +1357,7 @@ hol_help (struct hol *hol, const struct argp_state *state,
 {
   unsigned num;
   struct hol_entry *entry;
-  struct hol_help_state hhstate = { 0, 0, 0 };
+  struct hol_help_state hhstate = { NULL, 0, 0 };
 
   for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
     hol_entry_help (entry, state, stream, &hhstate);
@@ -1369,7 +1369,7 @@ hol_help (struct hol *hol, const struct argp_state *state,
 Mandatory or optional arguments to long options are also mandatory or \
 optional for any corresponding short options.");
       const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
-                                     state ? state->root_argp : 0, state);
+                                     state ? state->root_argp : NULL, state);
       if (fstr && *fstr)
         {
           __argp_fmtstream_putc (stream, '\n');
@@ -1602,11 +1602,11 @@ argp_doc (const struct argp *argp, const struct argp_state *state,
   if (doc)
     {
       char *vt = strchr (doc, '\v');
-      inp_text = post ? (vt ? vt + 1 : 0) : doc;
+      inp_text = post ? (vt ? vt + 1 : NULL) : doc;
       inp_text_limit = (!post && vt) ? (vt - doc) : 0;
     }
   else
-    inp_text = 0;
+    inp_text = NULL;
 
   if (argp->help_filter)
     /* We have to filter the doc strings.  */
@@ -1648,7 +1648,7 @@ argp_doc (const struct argp *argp, const struct argp_state *state,
   if (post && argp->help_filter)
     /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text.  */
     {
-      text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
+      text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, NULL, input);
       if (text)
         {
           if (anything || pre_blank)
@@ -1705,7 +1705,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
 
   if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
     {
-      hol = argp_hol (argp, 0);
+      hol = argp_hol (argp, NULL);
 
       /* If present, these options always come last.  */
       hol_set_group (hol, "help", -1);
@@ -1822,7 +1822,7 @@ Try '%s --help' or '%s --usage' for more information.\n"),
 void __argp_help (const struct argp *argp, FILE *stream,
                   unsigned flags, char *name)
 {
-  _help (argp, 0, stream, flags, name);
+  _help (argp, NULL, stream, flags, name);
 }
 #ifdef weak_alias
 weak_alias (__argp_help, argp_help)
@@ -1857,7 +1857,7 @@ __argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
       if (state && (state->flags & ARGP_LONG_ONLY))
         flags |= ARGP_HELP_LONG_ONLY;
 
-      _help (state ? state->root_argp : 0, state, stream, flags,
+      _help (state ? state->root_argp : NULL, state, stream, flags,
              state ? state->name : __argp_short_program_name ());
 
       if (!state || ! (state->flags & ARGP_NO_EXIT))
diff --git a/lib/argp-parse.c b/lib/argp-parse.c
index 6293169da4..96ba4e9c03 100644
--- a/lib/argp-parse.c
+++ b/lib/argp-parse.c
@@ -77,13 +77,13 @@ static volatile int _argp_hang;
 
 static const struct argp_option argp_default_options[] =
 {
-  {"help",        '?',          0, 0,  N_("give this help list"), -1},
-  {"usage",       OPT_USAGE,    0, 0,  N_("give a short usage message"), 0},
+  {"help",        '?',          NULL, 0,  N_("give this help list"), -1},
+  {"usage",       OPT_USAGE,    NULL, 0,  N_("give a short usage message"), 0},
   {"program-name",OPT_PROGNAME, N_("NAME"), OPTION_HIDDEN,
    N_("set the program name"), 0},
   {"HANG",        OPT_HANG,    N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
    N_("hang for SECS seconds (default 3600)"), 0},
-  {NULL, 0, 0, 0, NULL, 0}
+  {NULL, 0, NULL, 0, NULL, 0}
 };
 
 static error_t
@@ -139,8 +139,8 @@ static const struct argp argp_default_argp =
 
 static const struct argp_option argp_version_options[] =
 {
-  {"version",     'V',          0, 0,  N_("print program version"), -1},
-  {NULL, 0, 0, 0, NULL, 0}
+  {"version",     'V',          NULL, 0,  N_("print program version"), -1},
+  {NULL, 0, NULL, 0, NULL, 0}
 };
 
 static error_t
@@ -332,7 +332,7 @@ convert_options (const struct argp *argp,
                           ? optional_argument
                           : required_argument)
                        : no_argument);
-                    cvt->long_end->flag = 0;
+                    cvt->long_end->flag = NULL;
                     /* we add a disambiguating code to all the user's
                        values (which is removed before we actually call
                        the function to parse the value); this means that
@@ -408,7 +408,7 @@ parser_convert (struct parser *parser, const struct argp *argp, int flags)
   parser->argp = argp;
 
   if (argp)
-    parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
+    parser->egroup = convert_options (argp, NULL, 0, parser->groups, &cvt);
   else
     parser->egroup = parser->groups; /* No parsers at all! */
 }
@@ -537,7 +537,7 @@ parser_init (struct parser *parser, const struct argp *argp,
            makes very simple wrapper argps more convenient).  */
         group->child_inputs[0] = group->input;
 
-      err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
+      err = group_parse (group, &parser->state, ARGP_KEY_INIT, NULL);
     }
   if (err == EBADKEY)
     err = 0;                    /* Some parser didn't understand.  */
@@ -586,11 +586,11 @@ parser_finalize (struct parser *parser,
                group < parser->egroup && (!err || err==EBADKEY);
                group++)
             if (group->args_processed == 0)
-              err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
+              err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, NULL);
           for (group = parser->egroup - 1;
                group >= parser->groups && (!err || err==EBADKEY);
                group--)
-            err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
+            err = group_parse (group, &parser->state, ARGP_KEY_END, NULL);
 
           if (err == EBADKEY)
             err = 0;            /* Some parser didn't understand.  */
@@ -629,7 +629,7 @@ parser_finalize (struct parser *parser,
 
       /* Since we didn't exit, give each parser an error indication.  */
       for (group = parser->groups; group < parser->egroup; group++)
-        group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
+        group_parse (group, &parser->state, ARGP_KEY_ERROR, NULL);
     }
   else
     /* Notify parsers of success, and propagate back values from parsers.  */
@@ -640,14 +640,14 @@ parser_finalize (struct parser *parser,
       for (group = parser->egroup - 1
            ; group >= parser->groups && (!err || err == EBADKEY)
            ; group--)
-        err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
+        err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, NULL);
       if (err == EBADKEY)
         err = 0;                /* Some parser didn't understand.  */
     }
 
   /* Call parsers once more, to do any final cleanup.  Errors are ignored.  */
   for (group = parser->egroup - 1; group >= parser->groups; group--)
-    group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
+    group_parse (group, &parser->state, ARGP_KEY_FINI, NULL);
 
   if (err == EBADKEY)
     err = EINVAL;
@@ -686,7 +686,7 @@ parser_parse_arg (struct parser *parser, char *val)
         {
           parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg.  */
           key = ARGP_KEY_ARGS;
-          err = group_parse (group, &parser->state, key, 0);
+          err = group_parse (group, &parser->state, key, NULL);
         }
     }
 
@@ -799,11 +799,11 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
       parser->opt_data.optopt = KEY_END;
       if (parser->state.flags & ARGP_LONG_ONLY)
         opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
-                                   parser->short_opts, parser->long_opts, 0,
+                                   parser->short_opts, parser->long_opts, NULL,
                                    &parser->opt_data);
       else
         opt = _getopt_long_r (parser->state.argc, parser->state.argv,
-                              parser->short_opts, parser->long_opts, 0,
+                              parser->short_opts, parser->long_opts, NULL,
                               &parser->opt_data);
       /* And see what getopt did.  */
       parser->state.next = parser->opt_data.optind;
diff --git a/lib/backup-find.c b/lib/backup-find.c
index 5e39789d43..51ec43a7ad 100644
--- a/lib/backup-find.c
+++ b/lib/backup-find.c
@@ -70,7 +70,7 @@ ARGMATCH_VERIFY (backup_args, backup_types);
 enum backup_type
 get_version (char const *context, char const *version)
 {
-  if (version == 0 || *version == 0)
+  if (version == NULL || *version == 0)
     return numbered_existing_backups;
   else
     return XARGMATCH (context, version, backup_args, backup_types);
diff --git a/lib/bitset/list.c b/lib/bitset/list.c
index 0e1c9321a8..872cbf0158 100644
--- a/lib/bitset/list.c
+++ b/lib/bitset/list.c
@@ -95,7 +95,7 @@ lbitset_elt_alloc (void)
 {
   lbitset_elt *elt;
 
-  if (lbitset_free_list != 0)
+  if (lbitset_free_list != NULL)
     {
       elt = lbitset_free_list;
       lbitset_free_list = elt->next;
@@ -196,7 +196,7 @@ lbitset_elt_unlink (bitset bset, lbitset_elt *elt)
       else
         {
           bset->b.csize = 0;
-          bset->b.cdata = 0;
+          bset->b.cdata = NULL;
         }
     }
 
@@ -217,13 +217,13 @@ lbitset_prune (bitset bset, lbitset_elt *elt)
       LBITSET_TAIL (bset) = elt->prev;
       bset->b.cdata = elt->prev->words;
       bset->b.cindex = elt->prev->index;
-      elt->prev->next = 0;
+      elt->prev->next = NULL;
     }
   else
     {
-      LBITSET_HEAD (bset) = 0;
-      LBITSET_TAIL (bset) = 0;
-      bset->b.cdata = 0;
+      LBITSET_HEAD (bset) = NULL;
+      LBITSET_TAIL (bset) = NULL;
+      bset->b.cdata = NULL;
       bset->b.csize = 0;
     }
 
@@ -256,9 +256,9 @@ lbitset_elt_link (bitset bset, lbitset_elt *elt)
   lbitset_elt *current = bset->b.csize ? LBITSET_CURRENT (bset) : LBITSET_HEAD (bset);
 
   /* If this is the first and only element, add it in.  */
-  if (LBITSET_HEAD (bset) == 0)
+  if (LBITSET_HEAD (bset) == NULL)
     {
-      elt->next = elt->prev = 0;
+      elt->next = elt->prev = NULL;
       LBITSET_HEAD (bset) = elt;
       LBITSET_TAIL (bset) = elt;
     }
@@ -359,7 +359,7 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
       abort ();
 
     case LBITSET_FIND:
-      return 0;
+      return NULL;
 
     case LBITSET_CREATE:
       windex -= windex % LBITSET_ELT_WORDS;
@@ -439,7 +439,7 @@ lbitset_copy_ (bitset dst, bitset src)
   if (!head)
     return;
 
-  lbitset_elt *prev = 0;
+  lbitset_elt *prev = NULL;
   lbitset_elt *tmp;
   lbitset_elt *elt = head;
   do
@@ -447,7 +447,7 @@ lbitset_copy_ (bitset dst, bitset src)
       tmp = lbitset_elt_alloc ();
       tmp->index = elt->index;
       tmp->prev = prev;
-      tmp->next = 0;
+      tmp->next = NULL;
       if (prev)
         prev->next = tmp;
       else
@@ -487,7 +487,7 @@ lbitset_copy_cmp (bitset dst, bitset src)
   if (!LBITSET_HEAD (dst))
     {
       lbitset_copy (dst, src);
-      return LBITSET_HEAD (src) != 0;
+      return LBITSET_HEAD (src) != NULL;
     }
 
   if (lbitset_equal_p (dst, src))
@@ -942,7 +942,7 @@ lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
   lbitset_elt *delt = LBITSET_HEAD (dst);
   bool changed = false;
 
-  LBITSET_HEAD (dst) = 0;
+  LBITSET_HEAD (dst) = NULL;
   dst->b.csize = 0;
 
   bitset_windex windex1 = (selt1) ? selt1->index : BITSET_WINDEX_MAX;
@@ -1252,7 +1252,7 @@ lbitset_init (bitset bset, MAYBE_UNUSED bitset_bindex n_bits)
 void
 lbitset_release_memory (void)
 {
-  lbitset_free_list = 0;
+  lbitset_free_list = NULL;
   if (lbitset_obstack_init)
     {
       lbitset_obstack_init = false;
diff --git a/lib/bitset/stats.c b/lib/bitset/stats.c
index c06a450f7c..3eabf4e4cb 100644
--- a/lib/bitset/stats.c
+++ b/lib/bitset/stats.c
@@ -696,7 +696,7 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
   /* Disable cache.  */
   bset->b.cindex = 0;
   bset->b.csize = 0;
-  bset->b.cdata = 0;
+  bset->b.cdata = NULL;
 
   BITSET_NBITS_ (bset) = n_bits;
 
diff --git a/lib/bitset/table.c b/lib/bitset/table.c
index abd930e1b7..3bf6734aa8 100644
--- a/lib/bitset/table.c
+++ b/lib/bitset/table.c
@@ -98,7 +98,7 @@ static tbitset_elt *tbitset_free_list;  /* Free list of bitset elements.  */
 
 /* Disable bitset cache and mark BSET as being zero.  */
 #define TBITSET_ZERO_SET(BSET) ((BSET)->b.cindex = BITSET_WINDEX_MAX, \
-        (BSET)->b.cdata = 0)
+        (BSET)->b.cdata = NULL)
 
 #define TBITSET_CACHE_DISABLE(BSET)  ((BSET)->b.cindex = BITSET_WINDEX_MAX)
 
@@ -108,7 +108,7 @@ static tbitset_elt *tbitset_free_list;  /* Free list of bitset elements.  */
 
 /* A conservative estimate of whether the bitset is zero.
    This is non-zero only if we know for sure that the bitset is zero.  */
-#define TBITSET_ZERO_P(BSET) ((BSET)->b.cdata == 0)
+#define TBITSET_ZERO_P(BSET) ((BSET)->b.cdata == NULL)
 
 /* Enable cache to point to element with table index EINDEX.
    The element must exist.  */
@@ -179,7 +179,7 @@ tbitset_elt_alloc (void)
 {
   tbitset_elt *elt;
 
-  if (tbitset_free_list != 0)
+  if (tbitset_free_list != NULL)
     {
       elt = tbitset_free_list;
       tbitset_free_list = TBITSET_NEXT (elt);
@@ -251,7 +251,7 @@ tbitset_elt_remove (bitset bset, bitset_windex eindex)
   tbitset_elts *elts = TBITSET_ELTS (bset);
   tbitset_elt *elt = elts[eindex];
 
-  elts[eindex] = 0;
+  elts[eindex] = NULL;
   tbitset_elt_free (elt);
 }
 
@@ -818,8 +818,8 @@ tbitset_subset_p (bitset dst, bitset src)
 
   for (bitset_windex j = 0; j < ssize; j++)
     {
-      tbitset_elt *selt = j < ssize ? selts[j] : 0;
-      tbitset_elt *delt = j < dsize ? delts[j] : 0;
+      tbitset_elt *selt = j < ssize ? selts[j] : NULL;
+      tbitset_elt *delt = j < dsize ? delts[j] : NULL;
 
       if (!selt && !delt)
         continue;
@@ -850,8 +850,8 @@ tbitset_disjoint_p (bitset dst, bitset src)
 
   for (bitset_windex j = 0; j < ssize; j++)
     {
-      tbitset_elt *selt = j < ssize ? selts[j] : 0;
-      tbitset_elt *delt = j < dsize ? delts[j] : 0;
+      tbitset_elt *selt = j < ssize ? selts[j] : NULL;
+      tbitset_elt *delt = j < dsize ? delts[j] : NULL;
 
       if (!selt || !delt)
         continue;
@@ -886,9 +886,9 @@ tbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
   bitset_windex j = 0;
   for (j = 0; j < size; j++)
     {
-      tbitset_elt *selt1 = j < ssize1 ? selts1[j] : 0;
-      tbitset_elt *selt2 = j < ssize2 ? selts2[j] : 0;
-      tbitset_elt *delt = j < dsize ? delts[j] : 0;
+      tbitset_elt *selt1 = j < ssize1 ? selts1[j] : NULL;
+      tbitset_elt *selt2 = j < ssize2 ? selts2[j] : NULL;
+      tbitset_elt *delt = j < dsize ? delts[j] : NULL;
 
       if (!selt1 && !selt2)
         {
@@ -907,7 +907,7 @@ tbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
       if (!delt)
         delt = tbitset_elt_calloc ();
       else
-        delts[j] = 0;
+        delts[j] = NULL;
 
       bitset_word *srcp1 = TBITSET_WORDS (selt1);
       bitset_word *srcp2 = TBITSET_WORDS (selt2);
@@ -1150,7 +1150,7 @@ tbitset_init (bitset bset, bitset_bindex n_bits)
   TBITSET_ZERO_SET (bset);
 
   TBITSET_ASIZE (bset) = 0;
-  TBITSET_ELTS (bset) = 0;
+  TBITSET_ELTS (bset) = NULL;
   tbitset_resize (bset, n_bits);
 
   return bset;
@@ -1160,7 +1160,7 @@ tbitset_init (bitset bset, bitset_bindex n_bits)
 void
 tbitset_release_memory (void)
 {
-  tbitset_free_list = 0;
+  tbitset_free_list = NULL;
   if (tbitset_obstack_init)
     {
       tbitset_obstack_init = false;
diff --git a/lib/bitsetv.c b/lib/bitsetv.c
index 95da9b0649..e5e69dbebf 100644
--- a/lib/bitsetv.c
+++ b/lib/bitsetv.c
@@ -52,7 +52,7 @@ bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
     }
 
   /* Null terminate table.  */
-  bsetv[i] = 0;
+  bsetv[i] = NULL;
   return bsetv;
 }
 
diff --git a/lib/error.c b/lib/error.c
index f4f21bf2a7..abb64faf2e 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -197,7 +197,7 @@ print_errno_message (int errnum)
   if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
     s = errbuf;
   else
-    s = 0;
+    s = NULL;
 # endif
 #else
   s = strerror (errnum);
diff --git a/lib/exclude.c b/lib/exclude.c
index 568d1ec1c6..81549fa8fc 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -260,7 +260,7 @@ new_exclude_segment (struct exclude *ex, enum exclude_type type, int options)
   switch (type)
     {
     case exclude_pattern:
-      sp->v.pat = (struct exclude_pattern) {0};
+      sp->v.pat = (struct exclude_pattern) { NULL, 0, 0 };
       break;
 
     case exclude_hash:
diff --git a/lib/getopt.c b/lib/getopt.c
index ea2d1a529c..6d789326f2 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -732,7 +732,7 @@ _getopt_internal (int argc, char **argv, const char *optstring,
   NAME (int argc, char *const *argv, const char *optstring)	\
   {								\
     return _getopt_internal (argc, (char **)argv, optstring,	\
-			     0, 0, 0, POSIXLY_CORRECT);		\
+			     NULL, NULL, 0, POSIXLY_CORRECT);	\
   }
 
 #ifdef _LIBC
diff --git a/lib/human.c b/lib/human.c
index fbf45bb573..8e71d50fc6 100644
--- a/lib/human.c
+++ b/lib/human.c
@@ -397,7 +397,7 @@ human_readable (uintmax_t n, char *buf, int opts,
 # define DEFAULT_BLOCK_SIZE 1024
 #endif
 
-static char const *const block_size_args[] = { "human-readable", "si", 0 };
+static char const *const block_size_args[] = { "human-readable", "si", NULL };
 static int const block_size_opts[] =
   {
     human_autoscale + human_SI + human_base_1024,
diff --git a/lib/obstack.c b/lib/obstack.c
index b00cd88e1a..9b3a698e00 100644
--- a/lib/obstack.c
+++ b/lib/obstack.c
@@ -118,7 +118,7 @@ _obstack_begin_worker (struct obstack *h,
   h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
                                                alignment - 1);
   h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size;
-  chunk->prev = 0;
+  chunk->prev = NULL;
   /* The initial chunk now contains no empty object.  */
   h->maybe_empty_object = 0;
   h->alloc_failed = 0;
@@ -161,7 +161,7 @@ void
 _obstack_newchunk (struct obstack *h, _OBSTACK_SIZE_T length)
 {
   struct _obstack_chunk *old_chunk = h->chunk;
-  struct _obstack_chunk *new_chunk = 0;
+  struct _obstack_chunk *new_chunk = NULL;
   size_t obj_size = h->next_free - h->object_base;
   char *object_base;
 
@@ -226,12 +226,12 @@ _obstack_allocated_p (struct obstack *h, void *obj)
   /* We use >= rather than > since the object cannot be exactly at
      the beginning of the chunk but might be an empty object exactly
      at the end of an adjacent chunk.  */
-  while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
+  while (lp != NULL && ((void *) lp >= obj || (void *) (lp)->limit < obj))
     {
       plp = lp->prev;
       lp = plp;
     }
-  return lp != 0;
+  return lp != NULL;
 }
 
 /* Free objects in obstack H, including OBJ and everything allocate
@@ -247,7 +247,7 @@ _obstack_free (struct obstack *h, void *obj)
   /* We use >= because there cannot be an object at the beginning of a chunk.
      But there can be an empty object at that address
      at the end of another chunk.  */
-  while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
+  while (lp != NULL && ((void *) lp >= obj || (void *) (lp)->limit < obj))
     {
       plp = lp->prev;
       call_freefun (h, lp);
@@ -262,7 +262,7 @@ _obstack_free (struct obstack *h, void *obj)
       h->chunk_limit = lp->limit;
       h->chunk = lp;
     }
-  else if (obj != 0)
+  else if (obj != NULL)
     /* obj is not in any of the chunks! */
     abort ();
 }
@@ -273,7 +273,7 @@ _obstack_memory_used (struct obstack *h)
   struct _obstack_chunk *lp;
   _OBSTACK_SIZE_T nbytes = 0;
 
-  for (lp = h->chunk; lp != 0; lp = lp->prev)
+  for (lp = h->chunk; lp != NULL; lp = lp->prev)
     {
       nbytes += lp->limit - (char *) lp;
     }
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 8e359beead..00977f5714 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -86,7 +86,7 @@ char const *const quoting_style_args[] =
   "escape",
   "locale",
   "clocale",
-  0
+  NULL
 };
 
 /* Correspondences to quoting style names.  */
@@ -255,7 +255,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
   size_t i;
   size_t len = 0;
   size_t orig_buffersize = 0;
-  char const *quote_string = 0;
+  char const *quote_string = NULL;
   size_t quote_string_len = 0;
   bool backslash_escapes = false;
   bool unibyte_locale = MB_CUR_MAX == 1;
@@ -811,7 +811,7 @@ quotearg_alloc_mem (char const *arg, size_t argsize, size_t *size,
   int e = errno;
   /* Elide embedded null bytes if we can't return a size.  */
   int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES);
-  size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style,
+  size_t bufsize = quotearg_buffer_restyled (NULL, 0, arg, argsize, p->style,
                                              flags, p->quote_these_too,
                                              p->left_quote,
                                              p->right_quote) + 1;
diff --git a/lib/readutmp.c b/lib/readutmp.c
index 0938a094cb..7510fe8020 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -332,7 +332,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
       return 0;
     }
 
-  struct utmp_alloc a = {0};
+  struct utmp_alloc a = { NULL, 0, 0, 0 };
 
 # if READUTMP_USE_SYSTEMD || HAVE_UTMPX_H || HAVE_UTMP_H
 
diff --git a/lib/savedir.c b/lib/savedir.c
index 7cf4c2a69f..41b1e91660 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -87,7 +87,7 @@ typedef int (*comparison_function) (void const *, void const *, void *);
 
 static comparison_function const comparison_function_table[] =
   {
-    0,
+    NULL,
     direntry_cmp_name
 #if D_INO_IN_DIRENT
     , direntry_cmp_inode
diff --git a/lib/settime.c b/lib/settime.c
index 493bf0f57a..88609c637f 100644
--- a/lib/settime.c
+++ b/lib/settime.c
@@ -43,7 +43,7 @@ settime (struct timespec const *ts)
   {
     struct timeval tv = { .tv_sec = ts->tv_sec,
                           .tv_usec = ts->tv_nsec / 1000 };
-    return settimeofday (&tv, 0);
+    return settimeofday (&tv, NULL);
   }
 #elif HAVE_STIME
   /* This fails to compile on OSF1 V5.1, due to stime requiring
diff --git a/tests/nap.h b/tests/nap.h
index 1b9ae59287..94e100c021 100644
--- a/tests/nap.h
+++ b/tests/nap.h
@@ -98,7 +98,7 @@ nap_works (int delay, struct stat old_st)
   struct timespec delay_spec;
   delay_spec.tv_sec = delay / 1000000000;
   delay_spec.tv_nsec = delay % 1000000000;
-  ASSERT (nanosleep (&delay_spec, 0) == 0);
+  ASSERT (nanosleep (&delay_spec, NULL) == 0);
   nap_get_stat (&st, 1);
 
   if (diff_timespec (get_stat_mtime (&st), get_stat_mtime (&old_st)))
diff --git a/tests/test-fts.c b/tests/test-fts.c
index f5ab8355e1..b7e2633d70 100644
--- a/tests/test-fts.c
+++ b/tests/test-fts.c
@@ -29,7 +29,7 @@
 #define BASE "t-fts.tmp"
 static char base[] = BASE; /* Not const, since argv needs non-const.  */
 static char const base_d[] = BASE "/d";
-static char *const argv[2] = { base, 0 };
+static char *const argv[2] = { base, NULL };
 
 static void
 perror_exit (char const *message, int status)
@@ -43,8 +43,8 @@ static void
 fts_dealloc (void)
 {
   static char dir[] = "./";
-  static char *const curr_dir[2] = { dir, 0 };
-  FTS *ftsp = fts_open (curr_dir, FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, 0);
+  static char *const curr_dir[2] = { dir, NULL };
+  FTS *ftsp = fts_open (curr_dir, FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, NULL);
   if (ftsp)
     {
       if (fts_close (ftsp) != 0)
@@ -59,7 +59,7 @@ static void
 remove_tree (void)
 {
   FTSENT *e;
-  FTS *ftsp = fts_open (argv, FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, 0);
+  FTS *ftsp = fts_open (argv, FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, NULL);
   if (ftsp)
     {
       while ((e = fts_read (ftsp)))
@@ -135,7 +135,8 @@ main (void)
     }
 
   /* Use fts to look for the needles.  */
-  ftsp = fts_open (argv, FTS_SEEDOT | FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, 0);
+  ftsp = fts_open (argv, FTS_SEEDOT | FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD,
+                   NULL);
   if (!ftsp)
     perror_exit (base, 6);
   while ((e = fts_read (ftsp)))
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index d6e56ea7d9..5242da4b9a 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -82,7 +82,7 @@ simple (char const *host, char const *service)
   hints.ai_family = AF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;
 
-  res = getaddrinfo (host, service, 0, &ai0);
+  res = getaddrinfo (host, service, NULL, &ai0);
   err = errno;
 
   dbgprintf ("res %d: %s\n", res, gai_strerror (res));
diff --git a/tests/test-nstrftime.h b/tests/test-nstrftime.h
index b822f3acd1..a8de3abda7 100644
--- a/tests/test-nstrftime.h
+++ b/tests/test-nstrftime.h
@@ -71,7 +71,7 @@ posixtm_test (void)
 
       ASSERT (tm);
 
-      n = FUNC_CHECKED (buf, sizeof buf, T[i].fmt, tm, 0, T[i].in_ns);
+      n = FUNC_CHECKED (buf, sizeof buf, T[i].fmt, tm, NULL, T[i].in_ns);
       if (n == 0)
         {
           fail = 1;
@@ -103,38 +103,38 @@ static struct tzalloc_test TZ[] =
   {
 #define Pacific 0
 #if defined _WIN32 && !defined __CYGWIN__
-    { 0, "PST8PDT"                     },
+    { NULL, "PST8PDT"                     },
 #else
-    { 0, "PST8PDT,M3.2.0,M11.1.0"      },
+    { NULL, "PST8PDT,M3.2.0,M11.1.0"      },
 #endif
 
 #define Arizona 1
-    { 0, "MST7"                        },
+    { NULL, "MST7"                        },
 
 #define UTC 2
-    { 0, 0                             },
+    { NULL, NULL                          },
 
 #define CentEur 3
 #if defined _WIN32 && !defined __CYGWIN__
-    { 0, "CET-1CEST"                   },
+    { NULL, "CET-1CEST"                   },
 #else
-    { 0, "CET-1CEST,M3.5.0,M10.5.0/3"  },
+    { NULL, "CET-1CEST,M3.5.0,M10.5.0/3"  },
 #endif
 
 #define Japan 4
-    { 0, "JST-9"                       },
+    { NULL, "JST-9"                       },
 
 #define NZ 5
 #if defined _WIN32 && !defined __CYGWIN__
-    { 0, "NST-13NDT"                   },
+    { NULL, "NST-13NDT"                   },
 #else
-    { 0, "NZST-12NZDT,M9.5.0,M4.1.0/3" },
+    { NULL, "NZST-12NZDT,M9.5.0,M4.1.0/3" },
 #endif
 
 #define Unknown 6
-    { 0, "<-00>0" },
+    { NULL, "<-00>0" },
 
-    { 0 }
+    { NULL, NULL }
   };
 
 struct localtime_rz_test
@@ -188,7 +188,7 @@ static struct localtime_rz_test LT[] =
     { TZ+Unknown,  500000001, "1985-11-05 00:53:21 -0000 (-00)",  0 },
     { TZ+Unknown, 1000000002, "2001-09-09 01:46:42 -0000 (-00)",  0 },
 #endif
-    { 0 }
+    { NULL }
   };
 
 static int
@@ -280,7 +280,7 @@ quarter_test (void)
       struct tm qtm = { .tm_mon = mon - 1 };
       char fmt[3] = {'%','q','\0'};
 
-      size_t r = FUNC_CHECKED (out, sizeof (out), fmt, &qtm, 0, 0);
+      size_t r = FUNC_CHECKED (out, sizeof (out), fmt, &qtm, NULL, 0);
       if (r == 0)
         {
           printf ("%s(\"%%q\") failed\n", FUNC_NAME);
@@ -314,7 +314,7 @@ errno_test (void)
   int bigyear = LLONG_MAX - 1900 < INT_MAX ? LLONG_MAX - 1900 : INT_MAX;
 
   errno = 0;
-  n = FUNC_CHECKED (buf, 0, "%m", &tm, 0, 0);
+  n = FUNC_CHECKED (buf, 0, "%m", &tm, NULL, 0);
   if (! (n == 0 && errno == ERANGE))
     {
       fail = 1;
@@ -323,7 +323,7 @@ errno_test (void)
     }
 
   errno = 0;
-  n = FUNC_CHECKED (buf, sizeof buf, "", &tm, 0, 0);
+  n = FUNC_CHECKED (buf, sizeof buf, "", &tm, NULL, 0);
   if (! (n == 0 && errno == 0))
     {
       fail = 1;
@@ -334,7 +334,7 @@ errno_test (void)
 
   tm.tm_year = bigyear;
   errno = 0;
-  n = FUNC_CHECKED (buf, sizeof buf, "%s", &tm, 0, 0);
+  n = FUNC_CHECKED (buf, sizeof buf, "%s", &tm, NULL, 0);
   if (n == 0)
     {
       if (errno != EOVERFLOW)
@@ -344,7 +344,7 @@ errno_test (void)
           fflush (stdout);
         }
 
-      if (mktime_z (0, &tm) != (time_t) -1)
+      if (mktime_z (NULL, &tm) != (time_t) -1)
         {
           fail = 1;
           printf ("%s %%s failed but mktime_z worked for tm_year=%d\n",
@@ -369,7 +369,7 @@ errno_test (void)
           else
             {
               char buf1[sizeof buf];
-              size_t n1 = FUNC_CHECKED (buf1, sizeof buf1, "%s", tmp, 0, 0);
+              size_t n1 = FUNC_CHECKED (buf1, sizeof buf1, "%s", tmp, NULL, 0);
               buf1[n1] = '\0';
               if (! STREQ (buf, buf1))
                 {
@@ -402,7 +402,7 @@ locales_test (language_t language)
   char buf[100];
   size_t n;
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%+4Y-%m-%d %H:%M:%S.%N", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%+4Y-%m-%d %H:%M:%S.%N", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("Format as ISO 8601: %s\n", buf);
   fflush (stdout);
@@ -410,7 +410,7 @@ locales_test (language_t language)
 
   /* Exercise various POSIX format directives.  */
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%a", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%a", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%a directive: %s\n", buf);
   fflush (stdout);
@@ -425,7 +425,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%A", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%A", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%A directive: %s\n", buf);
   fflush (stdout);
@@ -440,7 +440,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%b", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%b", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%b directive: %s\n", buf);
   fflush (stdout);
@@ -455,7 +455,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%B", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%B", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%B directive: %s\n", buf);
   fflush (stdout);
@@ -469,7 +469,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%c", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%c", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%c directive: %s\n", buf);
   fflush (stdout);
@@ -488,49 +488,49 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%C", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%C", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%C directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "20"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%d", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%d", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%d directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "26"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%D", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%D", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%D directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "10/26/17"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%e", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%e", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%e directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "26"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%F", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%F", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%F directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "2017-10-26"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%g", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%g", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%g directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "17"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%G", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%G", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%G directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "2017"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%h", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%h", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%h directive: %s\n", buf);
   fflush (stdout);
@@ -545,43 +545,43 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%H", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%H", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%H directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "06"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%I", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%I", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%I directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "06"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%j", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%j", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%j directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "299"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%m", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%m", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%m directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "10"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%M", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%M", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%M directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "40"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%n", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%n", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%n directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "\n"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%p", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%p", tm, NULL, ns);
   switch (language)
     {
     case english:
@@ -595,7 +595,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%r", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%r", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%r directive: %s\n", buf);
   fflush (stdout);
@@ -611,61 +611,61 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%R", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%R", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%R directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "06:40"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%S", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%S", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%S directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "03"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%t", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%t", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%t directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "\t"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%T", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%T", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%T directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "06:40:03"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%u", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%u", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%u directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "4"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%U", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%U", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%U directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "43"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%V", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%V", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%V directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "43"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%w", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%w", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%w directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "4"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%W", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%W", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%W directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "43"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%x", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%x", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%x directive: %s\n", buf);
   fflush (stdout);
@@ -680,38 +680,38 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%X", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%X", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%X directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "06:40:03"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%y", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%y", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%y directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "17"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%Y", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%Y", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%Y directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "2017"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%z", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%z", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%z directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "+0000"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%Z", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%Z", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%Z directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, "GMT") /* glibc, NetBSD, OpenBSD, AIX, Solaris, Cygwin, Android */
           || STREQ (buf, "UTC") /* musl, macOS, FreeBSD */);
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%%", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%%", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%%% directive: %s\n", buf);
   fflush (stdout);
@@ -719,19 +719,19 @@ locales_test (language_t language)
 
   /* Exercise various GNU extensions from glibc.  */
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%k", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%k", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%k directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, " 6"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%l", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%l", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%l directive: %s\n", buf);
   fflush (stdout);
   ASSERT (STREQ (buf, " 6"));
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%P", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%P", tm, NULL, ns);
   switch (language)
     {
     case english:
@@ -745,7 +745,7 @@ locales_test (language_t language)
       break;
     }
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%s", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%s", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%s directive: %s\n", buf);
   fflush (stdout);
@@ -753,7 +753,7 @@ locales_test (language_t language)
 
   /* Exercise various GNU extensions from gnulib.  */
 
-  n = FUNC_CHECKED (buf, sizeof buf, "%N", tm, 0, ns);
+  n = FUNC_CHECKED (buf, sizeof buf, "%N", tm, NULL, ns);
   ASSERT (n > 0);
   printf ("%%N directive: %s\n", buf);
   fflush (stdout);
diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c
index 133b2c3e06..cdf3c7028b 100644
--- a/tests/test-parse-datetime.c
+++ b/tests/test-parse-datetime.c
@@ -148,7 +148,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01T11:55:18";
   expected.tv_sec = ref_time - gmtoff;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -158,7 +158,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01 11:55:18";
   expected.tv_sec = ref_time - gmtoff;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -168,7 +168,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01 11:55:18J";
   expected.tv_sec = ref_time - gmtoff;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -179,7 +179,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01T11:55:18Z";
   expected.tv_sec = ref_time;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -189,7 +189,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01 11:55:18Z";
   expected.tv_sec = ref_time;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -200,7 +200,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01T11:55:18-07:00";
   expected.tv_sec = 1304276118;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -210,7 +210,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01 11:55:18-07:00";
   expected.tv_sec = 1304276118;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -221,7 +221,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01T11:55:18-07";
   expected.tv_sec = 1304276118;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
@@ -231,7 +231,7 @@ main (_GL_UNUSED int argc, char **argv)
   p = "2011-05-01 11:55:18-07";
   expected.tv_sec = 1304276118;
   expected.tv_nsec = 0;
-  ASSERT (parse_datetime (&result, p, 0));
+  ASSERT (parse_datetime (&result, p, NULL));
   LOG (p, expected, result);
   ASSERT (expected.tv_sec == result.tv_sec
           && expected.tv_nsec == result.tv_nsec);
diff --git a/tests/test-regex.c b/tests/test-regex.c
index 175cdf4fe6..8d0c0d8c55 100644
--- a/tests/test-regex.c
+++ b/tests/test-regex.c
@@ -241,7 +241,7 @@ main (void)
             {
               memset (&regs, 0, sizeof regs);
               i = re_search (&regex, data, sizeof data - 1,
-                             0, sizeof data - 1, 0);
+                             0, sizeof data - 1, NULL);
               if (i != 0 && i != 21)
                 report_error ("re_search '%s' on '%s' returned %d",
                               pat, data, i);
@@ -338,7 +338,7 @@ main (void)
   memset (&regex, 0, sizeof regex);
   static char const pat_b_a[] = "a[b-a]";
   s = re_compile_pattern (pat_b_a, sizeof pat_b_a - 1, &regex);
-  if (s == 0)
+  if (s == NULL)
     {
       report_error ("re_compile_pattern: failed to reject '%s'", pat_b_a);
       regfree (&regex);
-- 
2.34.1

Reply via email to