From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81089 invoked by alias); 25 Aug 2017 05:30:09 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 80544 invoked by uid 89); 25 Aug 2017 05:29:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=9613 X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Aug 2017 05:29:07 +0000 Received: from [78.47.166.52] (helo=sslproxy04.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dl7B3-00055s-2j for newlib@sourceware.org; Fri, 25 Aug 2017 07:29:05 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy04.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dl7B2-0005pP-RD for newlib@sourceware.org; Fri, 25 Aug 2017 07:29:04 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D00812A0A9D for ; Fri, 25 Aug 2017 07:29:45 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id CFcQjDvakA19 for ; Fri, 25 Aug 2017 07:29:44 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id CD7BE2A166C for ; Fri, 25 Aug 2017 07:29:44 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uQJPOnJIUblg for ; Fri, 25 Aug 2017 07:29:44 +0200 (CEST) Received: from linux-diu0.suse (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id ACB8B2A0A9D for ; Fri, 25 Aug 2017 07:29:44 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH] Enable XSI extensions by default Date: Fri, 25 Aug 2017 06:15:00 -0000 Message-Id: <20170825052903.3030-1-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00871.txt.bz2 This test program #include int f(int i) { return ffs(i); } resulted in the follwing GCC warning warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration] This is not the case for glibc and FreeBSD. On FreeBSD __XSI_VISBLE is by default defined to 700. Do this also on Newlib. Signed-off-by: Sebastian Huber --- newlib/libc/include/sys/features.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index c9133af57..4102903bc 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -96,13 +96,13 @@ extern "C" { * _GNU_SOURCE * All of the above plus GNU extensions * * _BSD_SOURCE (deprecated by _DEFAULT_SOURCE) * _SVID_SOURCE (deprecated by _DEFAULT_SOURCE) * _DEFAULT_SOURCE (or none of the above) - * POSIX-1.2008 with BSD and SVr4 extensions + * POSIX-1.2008 with BSD, SVr4 and XSI extensions */ #ifdef _GNU_SOURCE #undef _ATFILE_SOURCE #define _ATFILE_SOURCE 1 #undef _DEFAULT_SOURCE @@ -131,12 +131,14 @@ extern "C" { #if defined(_DEFAULT_SOURCE) #undef _POSIX_SOURCE #define _POSIX_SOURCE 1 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 #endif #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \ ((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \ (_XOPEN_SOURCE - 0) >= 500) #define _POSIX_SOURCE 1 @@ -197,13 +199,13 @@ extern "C" { * SUSv2 XSI extensions; enabled with _XOPEN_SOURCE >= 500. * * __XSI_VISIBLE >= 600 * SUSv3 XSI extensions; enabled with _XOPEN_SOURCE >= 600. * * __XSI_VISIBLE >= 700 - * SUSv4 XSI extensions; enabled with _XOPEN_SOURCE >= 700. + * SUSv4 XSI extensions; enabled by default, or with _XOPEN_SOURCE >= 700. * * __ISO_C_VISIBLE >= 1999 * ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5), * any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L, * or _XOPEN_SOURCE >= 600. * -- 2.12.3