From patchwork Wed Sep 18 08:32:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1163828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-509166-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="RzhB5mlg"; dkim-atps=neutral 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 46YCt21M2Rz9s4Y for ; Wed, 18 Sep 2019 18:33:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=cazLNkdmhHB2kGMihyV0m9QhLfYWVTwNnzwldWis31k/x7HXpO FC0Hk8o6G65HXB2z1R4g3qgmRixXMrfugrIuVmc7fIZtcvPM8+0A3hTGMoBUVM1i jgn5ZLPb1+OkkoI24chw94s4SXAswi1/y6omu6Yqegk8+MtUvcZeWwlz8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=VEkaxbGLZj9GgPSQlQ1l4qrE0bs=; b=RzhB5mlg4Mqe0sdnMljX C4UgQLKr3yqK/84FovZyhiTVOpoOqSUCks9yxZz8VRFl02KrOnM3U5xSWOW4Xo8d XD2+pvNbi5J6HK10ZOYgsu8hl4zEZI0CtU6OPIXcuRKXfZyF/sKgJNMRQPv196M+ Vm4raPuGdaxEHi93GW7yZ0I= Received: (qmail 89779 invoked by alias); 18 Sep 2019 08:33:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 89765 invoked by uid 89); 18 Sep 2019 08:33:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2019 08:33:04 +0000 IronPort-SDR: 9lphCmk0ByNiqrhNLhRRdaULrppaNk+JvgT4aGSmwQmxBGhqHtjdfNPzJm7aKJ+PSpKahBAoXC fgzJsAAvMBgSsip/cY22LSKSrwC8F1cLQtwaLwC/1jc46/8Incxg6uigREc7/eEn1K8yYO+EKy qEnah0ReoD2JqYS8ikNFpNmcw4zdLV8SvULeRfYXU+kgPprxIobCNwRHMuJjUL2cF/5jScQldo lYF5bu4o7byS9uHq18zNiZ/DtQi6mmxHVT6Mi3VHbSMhpwNEjc5pKI0o2sdCjOYERC2jyEnytj DjI= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 18 Sep 2019 00:33:02 -0800 IronPort-SDR: e/eT0hLibZSDBDSUI5pdyKOwr98DZePDmeiD7+36b/02zxUojVBZ2d9VUKLFHE3ZhMRKEbGubg 0yE8xlMBtFhYD7rnYxd/M33N3oAIycBgPPRwtCnF4Epuxqf2HNaBGi4tkmZfJ3l1lkhVG2PLcR DN/K7a3kkVOvBZOP/v4b3GzgVusuUZd2XI+TrModRZ9islszjNyrfs/K9wVcvEvFzXCc4zWweJ lOZzFo17nTUOw9KC1a5HcumGRs/WXdkO9dLFmFHx75Zi31CZJEHTLP5Anxy4xxBlmRsZ1P2Zqs cNE= To: CC: Thomas Schwinge , Andrew Stubbs From: Tobias Burnus Subject: [patch, committed] Use PRId64 in libgomp/config/linux Message-ID: <6c679700-0cb8-0242-0738-9b217ad65cce@codesourcery.com> Date: Wed, 18 Sep 2019 10:32:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Use PRId64 if available, otherwise use a cast. For some reasons, it failed during bootstrap with a -Werror even though %ld should be okay with int64_t on x86_64-gnu-linux. Nonetheless, using PRId64 is better. Committed after testing on x86_64-gnu-linux. Tobias commit 8a8ebae1a419e1d3642d22874195acf6d5bae7d8 Author: Tobias Burnus Date: Wed Sep 18 10:27:39 2019 +0200 Use PRId64 if available libgomp/ 2019-09-18 Tobias Burnus * linux/gomp_print.c (gomp_print_integer): Use PRId64 if available, otherwise cast for %ld. diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index 1006b8149c8..db7f2a43b80 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-09-18 Tobias Burnus + + * linux/gomp_print.c (gomp_print_integer): Use PRId64 if available, + otherwise cast for %ld. + 2019-09-17 Julian Brown * libgomp-plugin.h (GOMP_OFFLOAD_openacc_async_host2dev): Update diff --git a/libgomp/config/linux/gomp_print.c b/libgomp/config/linux/gomp_print.c index 811bdd6e9a9..8b2e383440f 100644 --- a/libgomp/config/linux/gomp_print.c +++ b/libgomp/config/linux/gomp_print.c @@ -1,6 +1,11 @@ #include #include +#include "config.h" /* For HAVE_INTTYPES_H. */ +#ifdef HAVE_INTTYPES_H +# include /* For PRId64. */ +#endif + void gomp_print_string (const char *msg, const char *value) { @@ -10,7 +15,11 @@ gomp_print_string (const char *msg, const char *value) void gomp_print_integer (const char *msg, int64_t value) { - printf ("%s%ld\n", msg, value); +#ifdef HAVE_INTTYPES_H + printf ("%s%" PRId64 "\n", msg, value); +#else + printf ("%s%ld\n", msg, (long) value); +#endif } void