summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-09-09 14:11:10 -0400
committerGitHub <noreply@github.com>2018-09-09 14:11:10 -0400
commit5381b930b38edbf6797ae058593546b718133cb1 (patch)
treeaeaabaa7a8231f096f91d07d9a488564761a9a82 /lib
parent55e6c1329f78d5c672a58ff1fad86d7711a649c3 (diff)
parent7b34167d7dac6e898c49c675cfc80ae68c64bc98 (diff)
Merge pull request #2965 from opensourcerouting/buildfoo-20180904
more build fixes & warning-free build
Diffstat (limited to 'lib')
-rw-r--r--lib/command_lex.l5
-rw-r--r--lib/csv.c5
-rw-r--r--lib/defun_lex.l7
-rw-r--r--lib/ferr.c4
-rw-r--r--lib/frr_pthread.c13
-rw-r--r--lib/frrstr.c4
-rw-r--r--lib/grammar_sandbox.c4
-rw-r--r--lib/grammar_sandbox_main.c4
-rw-r--r--lib/hook.c4
-rw-r--r--lib/if.c2
-rw-r--r--lib/lib_errors.c4
-rw-r--r--lib/memory.c3
-rw-r--r--lib/openbsd-tree.c4
-rw-r--r--lib/ptm_lib.c5
-rw-r--r--lib/stream.c8
-rw-r--r--lib/strlcat.c6
-rw-r--r--lib/strlcpy.c6
-rw-r--r--lib/subdir.am5
-rw-r--r--lib/zebra.h1
19 files changed, 78 insertions, 16 deletions
diff --git a/lib/command_lex.l b/lib/command_lex.l
index 0d6e6ee7e5..3b18b58a2e 100644
--- a/lib/command_lex.l
+++ b/lib/command_lex.l
@@ -22,6 +22,11 @@
* 02111-1307, USA.
*/
+%top{
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+}
%{
/* ignore flex generated code in static analyzer */
#ifndef __clang_analyzer__
diff --git a/lib/csv.c b/lib/csv.c
index 2752974df5..582106ebd4 100644
--- a/lib/csv.c
+++ b/lib/csv.c
@@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/defun_lex.l b/lib/defun_lex.l
index d901c26a2e..6c0805a4fa 100644
--- a/lib/defun_lex.l
+++ b/lib/defun_lex.l
@@ -1,4 +1,3 @@
-%{
/*
* clippy (CLI preparator in python) C pseudo-lexer
* Copyright (C) 2016-2017 David Lamparter for NetDEF, Inc.
@@ -34,6 +33,12 @@
* code documentation in it.
*/
+%top{
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+}
+%{
/* ignore harmless bugs in old versions of flex */
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-value"
diff --git a/lib/ferr.c b/lib/ferr.c
index fb5719d4de..afef196cec 100644
--- a/lib/ferr.c
+++ b/lib/ferr.c
@@ -14,6 +14,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c
index c0aae5e52e..d48b23f38a 100644
--- a/lib/frr_pthread.c
+++ b/lib/frr_pthread.c
@@ -19,6 +19,9 @@
#include <zebra.h>
#include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
#include <sched.h>
#include "frr_pthread.h"
@@ -163,10 +166,14 @@ int frr_pthread_set_name(struct frr_pthread *fpt, const char *name,
pthread_mutex_lock(&fpt->mtx);
snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name);
pthread_mutex_unlock(&fpt->mtx);
-#ifdef GNU_LINUX
+#ifdef HAVE_PTHREAD_SETNAME_NP
+# ifdef GNU_LINUX
ret = pthread_setname_np(fpt->thread, fpt->os_name);
-#elif defined(OPEN_BSD)
- ret = pthread_set_name_np(fpt->thread, fpt->os_name);
+# else /* NetBSD */
+ ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL);
+# endif
+#elif defined(HAVE_PTHREAD_SET_NAME_NP)
+ pthread_set_name_np(fpt->thread, fpt->os_name);
#endif
}
diff --git a/lib/frrstr.c b/lib/frrstr.c
index 715e67b868..85d968182b 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c
index 51e7a3987e..ef03e85217 100644
--- a/lib/grammar_sandbox.c
+++ b/lib/grammar_sandbox.c
@@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "command.h"
#include "memory_vty.h"
#include "graph.h"
diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c
index 264c7c48f0..c9c942f9bf 100644
--- a/lib/grammar_sandbox_main.c
+++ b/lib/grammar_sandbox_main.c
@@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "command.h"
#include "memory_vty.h"
diff --git a/lib/hook.c b/lib/hook.c
index 935064f4d2..4fe305f282 100644
--- a/lib/hook.c
+++ b/lib/hook.c
@@ -20,6 +20,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "memory.h"
#include "hook.h"
diff --git a/lib/if.c b/lib/if.c
index 2bf0c6e6b5..a03c9da6f9 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -619,7 +619,7 @@ DEFUN (no_interface_desc,
* if not:
* - no idea, just get the name in its entirety.
*/
-static struct interface *if_sunwzebra_get(char *name, vrf_id_t vrf_id)
+static struct interface *if_sunwzebra_get(const char *name, vrf_id_t vrf_id)
{
struct interface *ifp;
char *cp;
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index 332a5b1d45..2ddc571e68 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "lib_errors.h"
/* clang-format off */
diff --git a/lib/memory.c b/lib/memory.c
index 695bbfe115..fee23a75ac 100644
--- a/lib/memory.c
+++ b/lib/memory.c
@@ -20,6 +20,9 @@
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
+#ifdef HAVE_MALLOC_NP_H
+#include <malloc_np.h>
+#endif
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#endif
diff --git a/lib/openbsd-tree.c b/lib/openbsd-tree.c
index 35bfce3a89..e8d13339b6 100644
--- a/lib/openbsd-tree.c
+++ b/lib/openbsd-tree.c
@@ -41,6 +41,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <lib/openbsd-tree.h>
diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c
index 69fd61e2a0..7f868beda4 100644
--- a/lib/ptm_lib.c
+++ b/lib/ptm_lib.c
@@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/lib/stream.c b/lib/stream.c
index 55e7f64358..589a229256 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -270,7 +270,7 @@ void stream_forward_endp(struct stream *s, size_t size)
}
/* Copy from stream to destination. */
-inline bool stream_get2(void *dst, struct stream *s, size_t size)
+bool stream_get2(void *dst, struct stream *s, size_t size)
{
STREAM_VERIFY_SANE(s);
@@ -299,7 +299,7 @@ void stream_get(void *dst, struct stream *s, size_t size)
}
/* Get next character from the stream. */
-inline bool stream_getc2(struct stream *s, uint8_t *byte)
+bool stream_getc2(struct stream *s, uint8_t *byte)
{
STREAM_VERIFY_SANE(s);
@@ -344,7 +344,7 @@ uint8_t stream_getc_from(struct stream *s, size_t from)
return c;
}
-inline bool stream_getw2(struct stream *s, uint16_t *word)
+bool stream_getw2(struct stream *s, uint16_t *word)
{
STREAM_VERIFY_SANE(s);
@@ -465,7 +465,7 @@ void stream_get_from(void *dst, struct stream *s, size_t from, size_t size)
memcpy(dst, s->data + from, size);
}
-inline bool stream_getl2(struct stream *s, uint32_t *l)
+bool stream_getl2(struct stream *s, uint32_t *l)
{
STREAM_VERIFY_SANE(s);
diff --git a/lib/strlcat.c b/lib/strlcat.c
index be211f82a8..39773d9ac8 100644
--- a/lib/strlcat.c
+++ b/lib/strlcat.c
@@ -20,11 +20,13 @@
/* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdint.h>
#include <string.h>
-#include "config.h"
-
#ifndef HAVE_STRLCAT
#undef strlcat
diff --git a/lib/strlcpy.c b/lib/strlcpy.c
index b0c33ca7f4..71ee9f1a54 100644
--- a/lib/strlcpy.c
+++ b/lib/strlcpy.c
@@ -20,9 +20,11 @@
/* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
-#include <string.h>
-
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
+
+#include <string.h>
#ifndef HAVE_STRLCPY
#undef strlcpy
diff --git a/lib/subdir.am b/lib/subdir.am
index 09deb9bc1b..499bb94920 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -254,9 +254,10 @@ lib_grammar_sandbox_SOURCES = \
lib_grammar_sandbox_LDADD = \
lib/libfrr.la
-lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY @SAN_CLIPPY_FLAGS@
-lib_clippy_CFLAGS = $(PYTHON_CFLAGS) @SAN_CLIPPY_FLAGS@
+lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
+lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
lib_clippy_LDADD = $(PYTHON_LIBS)
+lib_clippy_LDFLAGS = -export-dynamic
lib_clippy_SOURCES = \
lib/clippy.c \
lib/command_graph.c \
diff --git a/lib/zebra.h b/lib/zebra.h
index 7b7a42d908..d80aa06935 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -28,7 +28,6 @@
#include "compiler.h"
#ifdef SUNOS_5
-#define _XPG4_2
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;