From patchwork Tue Feb 25 07:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dennis Lambe Jr." X-Patchwork-Id: 1243894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-110063-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=malsyned.net Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48RVll2KRVz9sP7 for ; Tue, 25 Feb 2020 18:23:30 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject:content-type :mime-version; q=dns; s=default; b=FxbgQoKDQKrqGqZ7YTP2nMY/7yHoT b6ZE1jhw0fnvcsgTFNayo2qdqGtq7r0tScIzep63aa2+WyGJGZPQgvk/WPORZnVd qcGRTWjSvBq+fzAR2wverWFgEm8Mjmg4e2yDHkjTM+GskUHLaAZK7LObTo9gwamN D0oArzQn8aYLDg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject:content-type :mime-version; s=default; bh=AsBrUcInXcvHZFMIOBJFeOZexwA=; b=HEF J1IYZxyNEAmU//qUfg/nz3Fcgp2NGX5XZfEJN2d/gHzbobNnwPKtnqzx2M+IACMu ut8qVbZc/HkJx0C6chbrB9parDiLeOqTMOhahInFpVbu++u29rJnywFjk+fLoa5p Nz2lrtmPOKCKuzizp8ZTQ3M33DlhS8SuR+L8NvQM= Received: (qmail 64876 invoked by alias); 25 Feb 2020 07:23:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 64868 invoked by uid 89); 25 Feb 2020 07:23:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: uofr.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=uofr.net; s=selector-1; h=MIME-Version:Content-Type:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CiKj+pXHQ22BgdNRN2UFejyT3xH1MdHIS5r8z/MAivw=; b=Wj3989YuxjjSlKeBAZpKpVGamN vfjX5SzgsJ3BIVecx1jOlDyWT/TqGMVP/zoFW4k7PRLUPJ4izIeMYGmWgxktRjaduE4vBGV34WbW8 7WCybfONYrQe3enyGuEDttXuthgcjRJic+sdtxtNQtBNsYCv/Db4IatTLUSJUn/Ddsek=; Date: Tue, 25 Feb 2020 07:23:20 +0000 Message-ID: <20200225072320.Horde.P83S0y7VfCmyChcsW8RVUF4@ssl.uofr.net> From: "Dennis Lambe Jr." To: libc-alpha@sourceware.org Subject: [PATCH] stdint: Use __extension__ on long long constants User-Agent: Horde Application Framework 5 MIME-Version: 1.0 Content-Disposition: inline Most uses of long long in stdint.h are guarded with __extension__ to prevent them from issuing warnings with -std=c89 -pedantic. However, on 32-bit platforms the 64-bit integer constant macros append LL or ULL without marking it as an __extension__. As a result, GCC issues this warning: $ gcc -m32 -std=c89 -pedantic -c -o stdintext.o stdintext.c In file included from stdint.h:9:0, from stdintext.c:1: stdintext.c:3:23: warning: use of C99 long long integer constant [-Wlong-long] uint64_t i = UINT64_C(0); Prefix all ## LL and ## ULL macros with __extension__ to suppress these warnings. --- stdlib/stdint.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/stdint.h b/stdlib/stdint.h index 2df07e485b..9fa45672db 100644 --- a/stdlib/stdint.h +++ b/stdlib/stdint.h @@ -106,8 +106,8 @@ typedef __uintmax_t uintmax_t; # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL # else -# define __INT64_C(c) c ## LL -# define __UINT64_C(c) c ## ULL +# define __INT64_C(c) (__extension__ c ## LL) +# define __UINT64_C(c) (__extension__ c ## ULL) # endif /* Limits of integral types. */ @@ -251,7 +251,7 @@ typedef __uintmax_t uintmax_t; # if __WORDSIZE == 64 # define INT64_C(c) c ## L # else -# define INT64_C(c) c ## LL +# define INT64_C(c) (__extension__ c ## LL) # endif /* Unsigned. */ @@ -261,7 +261,7 @@ typedef __uintmax_t uintmax_t; # if __WORDSIZE == 64 # define UINT64_C(c) c ## UL # else -# define UINT64_C(c) c ## ULL +# define UINT64_C(c) (__extension__ c ## ULL) # endif /* Maximal type. */ @@ -269,8 +269,8 @@ typedef __uintmax_t uintmax_t; # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL +# define INTMAX_C(c) (__extension__ c ## LL) +# define UINTMAX_C(c) (__extension__ c ## ULL) # endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)