[PATCH] build: Silence gcc warnings
by Eric Blake
The first warning is obvious:
xslt_ext.c: In function 'ipcalc_netmask':
xslt_ext.c:72:53: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long unsigned int' [-Wformat=]
"ipcalc:netmask: prefix %d not in the range 1 to 32", prefix);
~^ ~~~~~~
%ld
The second warning looks like it was intended to have a const pointer
to const contents, where the second 'const' was misplaced instead of
duplicated:
ncftool.c:96:33: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const struct command_def const *commands[];
^~~~~
ncftool.c:676:33: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const struct command_def const *commands[] = {
^~~~~
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/ncftool.c | 4 ++--
src/xslt_ext.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ncftool.c b/src/ncftool.c
index f1b5642..382c91d 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -93,7 +93,7 @@ struct command_opt {
/* Global variables */
-static const struct command_def const *commands[];
+static const struct command_def *const commands[];
struct netcf *ncf;
static const char *const progname = "ncftool";
@@ -673,7 +673,7 @@ static int parseline(struct command *cmd, char *line) {
return 0;
}
-static const struct command_def const *commands[] = {
+static const struct command_def *const commands[] = {
&cmd_list_def,
&cmd_dump_xml_def,
&cmd_define_def,
diff --git a/src/xslt_ext.c b/src/xslt_ext.c
index fec2c21..14e5f23 100644
--- a/src/xslt_ext.c
+++ b/src/xslt_ext.c
@@ -69,6 +69,6 @@ static void ipcalc_netmask(xmlXPathParserContextPtr ctxt, int nargs) {
if (prefix == 0 || prefix > 32) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
- "ipcalc:netmask: prefix %d not in the range 1 to 32", prefix);
+ "ipcalc:netmask: prefix %lu not in the range 1 to 32", prefix);
goto error;
}
--
2.17.1
5 years, 7 months
[PATCH] dutil_posix: Fix incorrect logic on waitpid
by Eric Blake
Detected by dcb:
dutil_posix.c:225]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
Without the patch, waitret can only ever be 0 or 1, which renders
the next line's check for -1 dead code.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/dutil_posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dutil_posix.c b/src/dutil_posix.c
index 1313514..11ccff6 100644
--- a/src/dutil_posix.c
+++ b/src/dutil_posix.c
@@ -220,7 +220,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output)
fclose(outfile);
outfile = NULL;
- while ((waitret = waitpid(childpid, &exitstatus, 0) == -1) &&
+ while (((waitret = waitpid(childpid, &exitstatus, 0)) == -1) &&
errno == EINTR) {
/* empty loop */
}
--
2.17.1
5 years, 7 months
[PATCH 0/2] a couple more small changes to the spec file
by Laine Stump
similar changes were recently made to the libvirt spec file.
Laine Stump (2):
rpm: simplify applying patches during rpmbuild
rpm: remove unused Group:
netcf.spec.in | 39 +--------------------------------------
1 file changed, 1 insertion(+), 38 deletions(-)
--
2.14.4
5 years, 8 months
[PATCH] remove Requires: bridge-utils, since that package is deprecated
by Laine Stump
netcf never directly used anything in bridge-utils - this dependency
only existed because netcf executes /sbin/ifup (which is in the
initscripts package), and in older versions of distros ifup executed
brctl, but initscripts lacked a Requires bridge-utils.
Signed-off-by: Laine Stump <laine(a)laine.org>
---
netcf.spec.in | 4 ----
1 file changed, 4 deletions(-)
diff --git a/netcf.spec.in b/netcf.spec.in
index 24a5463..883ed1a 100644
--- a/netcf.spec.in
+++ b/netcf.spec.in
@@ -92,10 +92,6 @@ developing applications that use %{name}.
Summary: Libraries for %{name}
Group: System Environment/Libraries
-# bridge-utils is needed because /sbin/ifup calls brctl
-# if you create a bridge device
-Requires: bridge-utils
-
%description libs
The libraries for %{name}.
--
2.14.4
5 years, 8 months