Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan]
@ 2017-02-20 22:12 Sami Kerola
  2017-03-14 13:03 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Kerola @ 2017-02-20 22:12 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Adding _FUNCTION_DEF definition will exclude compatibility type definitions
that do include void key word in empty argument list.

/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function
declaration of function 'Function'

These functions has been replaced by set of new ones in readline 4.2 (April
2001), and removed in 6.3 (February 2014).

Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 disk-utils/fdisk.c  | 1 +
 disk-utils/sfdisk.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 4ac58ee4d..f1cd3aa5a 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -23,6 +23,7 @@
 #include <limits.h>
 #include <libsmartcols.h>
 #ifdef HAVE_LIBREADLINE
+# define _FUNCTION_DEF
 # include <readline/readline.h>
 #endif
 
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index f4f9b6b1a..b492b0cb5 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 #include <libsmartcols.h>
 #ifdef HAVE_LIBREADLINE
+# define _FUNCTION_DEF
 # include <readline/readline.h>
 #endif
 #include <libgen.h>
-- 
2.11.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-14 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-20 22:12 [PATCH] fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan] Sami Kerola
2017-03-14 13:03 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox