summaryrefslogtreecommitdiffstats
path: root/kiss
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-01-26 19:09:57 +0100
committerRalf Baechle <ralf@linux-mips.org>2017-01-26 21:58:49 +0100
commit4abaef9b52543f64fba86b2ef26809a336a80afe (patch)
treeb0c363cc27785a101c073b93d480530603d497d7 /kiss
parentd8ca92a6794669235f044d62353d42e7573feb35 (diff)
Use the right way to get the required feature set from glibc.
__USE_XOPEN doesn't work to get ptsname() etc. from libc. This is Linux-specific software so convert to _GNU_SOURCE. make[2]: Entering directory '/home/ralf/src/ax25/ax25-tools/kiss' gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O 2 -Wall -pedantic -MT kissattach.o -MD -MP -MF .deps/kissattach.Tpo -c -o kissattach.o kissattach.c kissattach.c: In function ‘main’: kissattach.c:312:18: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((namepts = ptsname(fd)) == NULL) { ^~~~~~~ kissattach.c:312:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((namepts = ptsname(fd)) == NULL) { ^ kissattach.c:317:7: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(fd) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT kissnetd.o -MD -MP -MF .deps/kissnetd.Tpo -c -o kissnetd.o kissnetd.c kissnetd.c: In function ‘ReopenPort’: kissnetd.c:134:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(PortList[PortNumber]->Fd)) == NULL) { ^~~~~~~ kissnetd.c:134:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(PortList[PortNumber]->Fd)) == NULL) { ^ kissnetd.c:143:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(PortList[PortNumber]->Fd) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT mkiss.o -MD -MP -MF .deps/mkiss.Tpo -c -o mkiss.o mkiss.c mkiss.c: In function ‘poll’: mkiss.c:68:15: warning: overflow in implicit constant conversion [-Woverflow] #define FEND 0300 /* Frame End (0xC0) */ ^ mkiss.c:149:14: note: in expansion of macro ‘FEND’ buffer[0] = FEND; ^~~~ mkiss.c:68:15: warning: overflow in implicit constant conversion [-Woverflow] #define FEND 0300 /* Frame End (0xC0) */ ^ mkiss.c:151:14: note: in expansion of macro ‘FEND’ buffer[2] = FEND; ^~~~ mkiss.c: In function ‘main’: mkiss.c:568:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^~~~~~~ mkiss.c:568:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^ mkiss.c:578:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(pty[i]->fd) == -1) { ^~~~~~~~ mkiss.c:672:33: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "tty->fd: %m"); ^ mkiss.c:698:38: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "pty[%d]->fd: %m\n", i); [...] ^ gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT net2kiss.o -MD -MP -MF .deps/net2kiss.Tpo -c -o net2kiss.o net2kiss.c net2kiss.c: In function ‘main’: net2kiss.c:630:18: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((namepts = ptsname(fdpty)) == NULL) { ^~~~~~~ net2kiss.c:630:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((namepts = ptsname(fdpty)) == NULL) { ^ net2kiss.c:635:7: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(fdpty) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT m6pack.o -MD -MP -MF .deps/m6pack.Tpo -c -o m6pack.o m6pack.c m6pack.c: In function ‘main’: m6pack.c:537:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^~~~~~~ m6pack.c:537:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^ m6pack.c:545:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(pty[i]->fd) == -1) { ^~~~~~~~ m6pack.c:626:33: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "tty->fd: %m"); ^ m6pack.c:658:29: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] "pty[%d]->fd: %m\n",i); ^ [...] Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'kiss')
-rw-r--r--kiss/Makefile.am3
-rw-r--r--kiss/kissattach.c1
-rw-r--r--kiss/kissnetd.c1
-rw-r--r--kiss/mkiss.c1
-rw-r--r--kiss/net2kiss.c1
5 files changed, 2 insertions, 5 deletions
diff --git a/kiss/Makefile.am b/kiss/Makefile.am
index 0fd5db1..e7dcf30 100644
--- a/kiss/Makefile.am
+++ b/kiss/Makefile.am
@@ -8,7 +8,8 @@ LDADD= $(AX25_LIB)
dist_man_MANS = kissattach.8 spattach.8 kissnetd.8 kissparms.8 mkiss.8 \
net2kiss.8
-AM_CPPFLAGS = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \
+AM_CPPFLAGS = -D_GNU_SOURCE \
+ -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \
-DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\"
AX25_SYSCONFDIR=${sysconfdir}/ax25/
diff --git a/kiss/kissattach.c b/kiss/kissattach.c
index f4ff5cb..9667da1 100644
--- a/kiss/kissattach.c
+++ b/kiss/kissattach.c
@@ -1,5 +1,4 @@
#include <stdio.h>
-#define __USE_XOPEN
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/kiss/kissnetd.c b/kiss/kissnetd.c
index 7b64ad9..e8448ef 100644
--- a/kiss/kissnetd.c
+++ b/kiss/kissnetd.c
@@ -10,7 +10,6 @@
*/
#include <stdio.h>
-#define __USE_XOPEN
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
diff --git a/kiss/mkiss.c b/kiss/mkiss.c
index 3d709de..2904f70 100644
--- a/kiss/mkiss.c
+++ b/kiss/mkiss.c
@@ -38,7 +38,6 @@
*/
#include <stdio.h>
-#define __USE_XOPEN
#include <string.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/kiss/net2kiss.c b/kiss/net2kiss.c
index 1ec8524..d2f25bf 100644
--- a/kiss/net2kiss.c
+++ b/kiss/net2kiss.c
@@ -31,7 +31,6 @@
/*****************************************************************************/
#include <stdio.h>
-#define __USE_XOPEN
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>