9
0
Fork 0

scripts: fix warning generated by glibc 2.20

Defining only _BSD_SOURCE is deprecated with version 2.20 of
glibc. It has been replaced by _DEFAULT_SOURCE. The manpage says
that code which wants to work in the same way on both old and new
versions of glibc should simply define both symbols.

Also move the definition up in fix_size as those feature flags
should be defined before including any standard headers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2015-03-01 18:53:29 +01:00 committed by Sascha Hauer
parent f8d5736939
commit 603ba8c1ba
3 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,6 @@
#define _BSD_SOURCE /* See feature_test_macros(7) */
#define _DEFAULT_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
@ -6,9 +9,6 @@
#include <unistd.h>
#include <stdint.h>
#include <fcntl.h>
#ifndef _BSD_SOURCE
#define _BSD_SOURCE /* See feature_test_macros(7) */
#endif
#include <endian.h>
int main(int argc, char**argv)

View File

@ -34,6 +34,7 @@
*/
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#include <stdio.h>
#include <sys/types.h>

View File

@ -19,6 +19,7 @@
*/
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#include <stdio.h>
#include <sys/types.h>