Building fix about implicit declaration of strnlen
authorYang Ruirui <ruirui.r.yang@tieto.com>
Wed, 29 Dec 2010 07:12:15 +0000 (23:12 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 29 Dec 2010 07:12:15 +0000 (23:12 -0800)
I got build failing as below:
cc1: warnings being treated as errors
gdhcp/client.c: In function ‘alloc_dhcp_option’:
gdhcp/client.c:1455: error: implicit declaration of function ‘strnlen’

define _GNU_SOURCE fixes this problem.

gdhcp/client.c

index 107077a..8441104 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 #endif
 
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>