Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings on build #369

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ AC_CONFIG_FILES(m4_normalize(m4_foreach_w(THIS_PLUGIN,AVAILABLE_NCP_PLUGINS,[src
PLUGIN_SUBDIRS="[]m4_foreach_w(THIS_PLUGIN,AVAILABLE_NCP_PLUGINS,ncp-[]THIS_PLUGIN )"
AC_SUBST(PLUGIN_SUBDIRS)

AC_USE_SYSTEM_EXTENSIONS
AC_GNU_SOURCE
CFLAGS="$CFLAGS -D_GNU_SOURCE"

AM_INIT_AUTOMAKE()

AM_MAINTAINER_MODE
Expand Down
4 changes: 4 additions & 0 deletions src/util/nlpt-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
#include <config.h>
#endif

#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 1 // For the "fds_bits" member of "fd_set"
#ifndef __USE_XOPEN
#define __USE_XOPEN 1 // This too
#endif // __USE_XOPEN
#endif // _XOPEN_SOURCE

#include <stdio.h>
#include <stdint.h>
Expand Down
4 changes: 1 addition & 3 deletions src/util/socket-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <config.h>
#endif

#define _GNU_SOURCE 1

#include "assert-macros.h"

#include <stdio.h>
Expand Down Expand Up @@ -90,7 +88,7 @@ system_socket_table_close_alarm_(int sig)
static const char message[] = "\nclose_super_socket: Unable to terminate child in a timely manner, watchdog fired\n";

// Can't use syslog here, write to stderr instead.
(void)write(STDERR_FILENO, message, sizeof(message) - 1);
ssize_t len = write(STDERR_FILENO, message, sizeof(message) - 1);

_exit(EXIT_FAILURE);
}
Expand Down
6 changes: 4 additions & 2 deletions src/util/string-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
#endif

#include <stdio.h>
#include "string-utils.h"
#include <ctype.h>
#include <inttypes.h>
#include <stdlib.h>

#ifndef __USE_GNU
#define __USE_GNU // Needed for `strcasestr`
#include <string.h>
#endif

#include "string-utils.h"

void
memcpyrev(void *dest_, const void *src_, size_t len)
Expand Down