path_utils.c:89: possible bad precedence ?
Status: Alpha
Brought to you by:
braga
I just compiled the package with new C compiler clang-14.
It said:
path_utils.c:89:40: warning: operator '?:' has lower precedence than '-'; '-' will be evaluated first [-Wparentheses]
Source code is
ret = g_strdup_printf("%s%.*s%s",
ftpfs.host,
lastdir - path,
path,
lastdir - path ? "/" : "");
Maybe better code:
ret = g_strdup_printf("%s%.*s%s",
ftpfs.host,
lastdir - path,
path,
lastdir - (path ? "/" : ""));
It's been many years, but
lastdir - "/"orlastdir - ""don't make sense, so it should be(lastdir - path) ? "/" : ""