* Misc. compile warnings @ 2014-09-29 21:01 Bart Schaefer 2014-09-30 8:53 ` Peter Stephenson 0 siblings, 1 reply; 3+ messages in thread From: Bart Schaefer @ 2014-09-29 21:01 UTC (permalink / raw) To: zsh-workers Just upgraded Mavericks and am seeing some compile warnings I don't recall having encountered before: compctl.c:3419:11: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] *npp = '\0'; ^~~~ zle_refresh.c:432:13: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] *arrp = '\0'; ^~~~ zle_refresh.c:261:30: warning: unused variable 'zr_ht' [-Wunused-const-variable] static const REFRESH_ELEMENT zr_ht = { ZWC('\t'), 0 }; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Misc. compile warnings 2014-09-29 21:01 Misc. compile warnings Bart Schaefer @ 2014-09-30 8:53 ` Peter Stephenson 2014-10-29 14:09 ` Jun T. 0 siblings, 1 reply; 3+ messages in thread From: Peter Stephenson @ 2014-09-30 8:53 UTC (permalink / raw) To: zsh-workers On Mon, 29 Sep 2014 14:01:17 -0700 (PDT) Bart Schaefer <schaefer@brasslantern.com> wrote: > Just upgraded Mavericks and am seeing some compile warnings I don't recall > having encountered before: > > compctl.c:3419:11: warning: expression which evaluates to zero treated as a null > pointer constant of type 'char *' [-Wnon-literal-null-conversion] > *npp = '\0'; > ^~~~ > > zle_refresh.c:432:13: warning: expression which evaluates to zero treated as a > null pointer constant of type 'char *' [-Wnon-literal-null-conversion] > *arrp = '\0'; > ^~~~ The point is *npp and *arrp are char *, not char, so should be NULL, not a character zero. > zle_refresh.c:261:30: warning: unused variable 'zr_ht' [-Wunused-const-variable] > static const REFRESH_ELEMENT zr_ht = { ZWC('\t'), 0 }; Yes, it's not used. pws diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 52b9e9c..0b7a324 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -3416,7 +3416,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) *npp++ = tp; pp++; } - *npp = '\0'; + *npp = NULL; } } if (!dirs) { diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index 80be27f..684ac13 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -258,7 +258,6 @@ static const REFRESH_ELEMENT zr_cr = { ZWC('\r'), 0 }; static const REFRESH_ELEMENT zr_dt = { ZWC('.'), 0 }; static const REFRESH_ELEMENT zr_nl = { ZWC('\n'), 0 }; static const REFRESH_ELEMENT zr_sp = { ZWC(' '), 0 }; -static const REFRESH_ELEMENT zr_ht = { ZWC('\t'), 0 }; static const REFRESH_ELEMENT zr_zr = { ZWC('\0'), 0 }; /* @@ -429,7 +428,7 @@ get_region_highlight(UNUSED(Param pm)) digbuf1, digbuf2); (void)output_highlight(rhp->atr, *arrp + strlen(*arrp)); } - *arrp = '\0'; + *arrp = NULL; return retarr; } ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Misc. compile warnings 2014-09-30 8:53 ` Peter Stephenson @ 2014-10-29 14:09 ` Jun T. 0 siblings, 0 replies; 3+ messages in thread From: Jun T. @ 2014-10-29 14:09 UTC (permalink / raw) To: zsh-workers 2014/09/30 06:01, Bart Schaefer <schaefer@brasslantern.com> wrote: > Just upgraded Mavericks and am seeing some compile warnings The same 'zero treated as a null pointer constant' warning from zselect.c. diff --git a/Src/Modules/zselect.c b/Src/Modules/zselect.c index c020746..30a3f51 100644 --- a/Src/Modules/zselect.c +++ b/Src/Modules/zselect.c @@ -251,7 +251,7 @@ bin_zselect(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) outptr = outdata = (char **)zalloc((fdcount+1)*sizeof(char *)); while (nonempty(fdlist)) *outptr++ = getlinknode(fdlist); - *outptr = '\0'; + *outptr = NULL; /* and store in array parameter */ if (outhash) sethparam(outhash, outdata); ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-29 14:52 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-09-29 21:01 Misc. compile warnings Bart Schaefer 2014-09-30 8:53 ` Peter Stephenson 2014-10-29 14:09 ` Jun T.
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).