From eabf95c2c7476f4f75238bb8cd93bb01dde8b298 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 7 Jun 2015 00:45:49 +0200 Subject: netrom/netromt.c: Fix signedness compiler warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -g -O2 -Wall -MT netromt.o -MD -MP -MF .deps/netromt.Tpo -c -o netromt.o netromt.c netromt.c: In function ‘build_header’: netromt.c:30:9: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(message + 1, nr_config_get_alias(NULL)); ^ In file included from netromt.c:4:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ netromt.c:31:12: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign] strncat(message + 1, " ", MNEMONIC_LEN - strlen(message + 1)); ^ In file included from netromt.c:4:0: /usr/include/string.h:398:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ extern size_t strlen (const char *__s) ^ netromt.c:31:1: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in signedness [-Wpointer-sign] strncat(message + 1, " ", MNEMONIC_LEN - strlen(message + 1)); ^ netromt.c:31:1: note: expected ‘char *’ but argument is of type ‘unsigned char *’ netromt.c: In function ‘build_mine’: netromt.c:66:49: warning: pointer targets in passing argument 2 of ‘ax25_aton_entry’ differ in signedness [-Wpointer-sign] if (ax25_aton_entry(nr_config_get_addr(port), message + len) == -1) { ^ In file included from netromt.c:19:0: /usr/include/netax25/axlib.h:58:12: note: expected ‘char *’ but argument is of type ‘unsigned char *’ extern int ax25_aton_entry(const char *, char *); ^ netromt.c:74:10: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(message + len, nr_config_get_alias(port)); ^ In file included from netromt.c:4:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ netromt.c:75:13: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign] strncat(message + len, " ", MNEMONIC_LEN - strlen(message + len)); ^ In file included from netromt.c:4:0: /usr/include/string.h:398:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ extern size_t strlen (const char *__s) ^ netromt.c:75:2: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in signedness [-Wpointer-sign] strncat(message + len, " ", MNEMONIC_LEN - strlen(message + len)); ^ netromt.c:75:2: note: expected ‘char *’ but argument is of type ‘unsigned char *’ netromt.c:78:44: warning: pointer targets in passing argument 2 of ‘ax25_aton_entry’ differ in signedness [-Wpointer-sign] ax25_aton_entry(nr_config_get_addr(NULL), message + len); ^ In file included from netromt.c:19:0: /usr/include/netax25/axlib.h:58:12: note: expected ‘char *’ but argument is of type ‘unsigned char *’ extern int ax25_aton_entry(const char *, char *); ^ netromt.c: In function ‘build_others’: netromt.c:156:34: warning: pointer targets in passing argument 2 of ‘ax25_aton_entry’ differ in signedness [-Wpointer-sign] if (ax25_aton_entry(callsign, message + len) == -1) { ^ In file included from netromt.c:19:0: /usr/include/netax25/axlib.h:58:12: note: expected ‘char *’ but argument is of type ‘unsigned char *’ extern int ax25_aton_entry(const char *, char *); ^ netromt.c:163:11: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(message + len, mnemonic); ^ In file included from netromt.c:4:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ netromt.c:164:14: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign] strncat(message + len, " ", MNEMONIC_LEN - strlen(message + len)); ^ In file included from netromt.c:4:0: /usr/include/string.h:398:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ extern size_t strlen (const char *__s) ^ netromt.c:164:3: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in signedness [-Wpointer-sign] strncat(message + len, " ", MNEMONIC_LEN - strlen(message + len)); ^ netromt.c:164:3: note: expected ‘char *’ but argument is of type ‘unsigned char *’ netromt.c:167:35: warning: pointer targets in passing argument 2 of ‘ax25_aton_entry’ differ in signedness [-Wpointer-sign] if (ax25_aton_entry(neighbour, message + len) == -1) { ^ In file included from netromt.c:19:0: /usr/include/netax25/axlib.h:58:12: note: expected ‘char *’ but argument is of type ‘unsigned char *’ extern int ax25_aton_entry(const char *, char *); ^ [...] Signed-off-by: Ralf Baechle --- netrom/netromt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'netrom/netromt.c') diff --git a/netrom/netromt.c b/netrom/netromt.c index 2a5bc3c..17c17c3 100644 --- a/netrom/netromt.c +++ b/netrom/netromt.c @@ -23,7 +23,7 @@ #include "../pathnames.h" #include "netromd.h" -static int build_header(unsigned char *message) +static int build_header(char *message) { message[0] = NODES_SIG; @@ -35,7 +35,7 @@ static int build_header(unsigned char *message) static void build_mine(int s, struct full_sockaddr_ax25 *dest, int dlen, int localval, int pause) { - unsigned char message[100]; + char message[100]; char buffer[255], *port, *p; FILE *fp; int len; @@ -94,7 +94,7 @@ static void build_mine(int s, struct full_sockaddr_ax25 *dest, int dlen, int loc static void build_others(int s, int min_obs, struct full_sockaddr_ax25 *dest, int dlen, int port, int pause) { - unsigned char message[300]; + char message[300]; FILE *fpnodes, *fpneigh; char nodes_buffer[90]; char neigh_buffer[90]; -- cgit v1.2.3