From patchwork Thu Dec 7 21:35:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 10101109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BABBA60360 for ; Thu, 7 Dec 2017 21:35:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB6061FF87 for ; Thu, 7 Dec 2017 21:35:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B33828743; Thu, 7 Dec 2017 21:35:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5362D1FF87 for ; Thu, 7 Dec 2017 21:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750895AbdLGVfJ (ORCPT ); Thu, 7 Dec 2017 16:35:09 -0500 Received: from mga05.intel.com ([192.55.52.43]:19927 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdLGVfJ (ORCPT ); Thu, 7 Dec 2017 16:35:09 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2017 13:35:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,374,1508828400"; d="scan'208";a="185075794" Received: from theros.lm.intel.com ([10.232.112.77]) by fmsmga006.fm.intel.com with ESMTP; 07 Dec 2017 13:35:08 -0800 From: Ross Zwisler To: Eryu Guan , fstests Cc: Ross Zwisler Subject: [PATCH 1/3] xfstests: fix _BSD_SOURCE complier warning Date: Thu, 7 Dec 2017 14:35:01 -0700 Message-Id: <20171207213503.31070-1-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.14.3 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When compiling xfstests with either gcc 6.4.1 or 7.2.1 I see the following warning: In file included from /usr/include/stdio.h:27:0, from fssum.c:25: /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" ^~~~~~~ The feature_test_macros(7) man page says this about _BSD_SOURCE: Since glibc 2.20, this macro is deprecated. It now has the same effect as defining _DEFAULT_SOURCE, but generates a compile-time warning (unless _DEFAULT_SOURCE is also defined). Use _DEFAULT_SOURCE instead. To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE. Keep backwards compatibility with older code by defining both _BSD_SOURCE and _DEFAULT_SOURCE. Signed-off-by: Ross Zwisler --- src/fssum.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fssum.c b/src/fssum.c index 04052cdc..13111d6f 100644 --- a/src/fssum.c +++ b/src/fssum.c @@ -17,6 +17,7 @@ */ #ifdef __linux__ #define _BSD_SOURCE +#define _DEFAULT_SOURCE #define _LARGEFILE64_SOURCE #ifndef _GNU_SOURCE #define _GNU_SOURCE