From patchwork Fri May 3 10:53:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1094815 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-500060-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Zay83scV"; 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 44wTWK2Cmkz9s9N for ; Fri, 3 May 2019 20:53:17 +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:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=gtSMBL9GCXyPAPtw5jE/P5phlfl/UaB4z4Vy+lhEaP+vZe/XfA hKAOM0yTANSK+awOHZH1vXCUM5SU22z50A+kBuCY/P0l2f0WsYFchlNZ+JS9dhrp Hb3oT2Jc5OTmCEG8ukyXPrVH+y40B9k9rpLO7uFf6iRFg0X8+t9t5E1r4= 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:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=80Bi7Ej4JpjkA7WRvEYtnu+Y+6Y=; b=Zay83scVaeP0uKnZsCpA KJqHJtS8JWfoUR6EvdnK1wK6PFzmtIqVQrMbHi/wiT66FqRIEZsGU+G/JOi2xuS4 KXmA6+sNFRMH4giuc3maCmCokNfhXFcEwzTpLiZPHNDaFwaTSVXb2BOt9tHkLPnM Weo/vgIUWvpcLtZQPuQqkvU= Received: (qmail 103366 invoked by alias); 3 May 2019 10:53:09 -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 103351 invoked by uid 89); 3 May 2019 10:53:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=buildworker X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 May 2019 10:53:08 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 82ECBAEDB; Fri, 3 May 2019 10:53:06 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Silent -Wformat-truncation warnings in date_and_time.c. To: gcc-patches@gcc.gnu.org Cc: "fortran@gcc.gnu.org" Message-ID: <7882cc27-cff0-71a8-269f-88bfa7836147@suse.cz> Date: Fri, 3 May 2019 12:53:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi. The patch is about suppression of the following warning: /home/gcc/buildworker/zenith-gcc-trunk-weekly/build/libgfortran/intrinsics/date_and_time.c:165:33: warning: ā€˜%04dā€™ directive output may be truncated writing between 4 and 11 bytes into a region of size 9 [-Wformat-truncation=] /home/gcc/buildworker/zenith-gcc-trunk-weekly/build/libgfortran/intrinsics/date_and_time.c:172:33: warning: ā€˜%+03dā€™ directive output may be truncated writing between 3 and 9 bytes into a region of size 6 [-Wformat-truncation=] Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin libgfortran/ChangeLog: 2019-05-03 Martin Liska * intrinsics/date_and_time.c (DATE_LEN): Enlarge in order to deal with the warning. (ZONE_LEN): Likewise. --- libgfortran/intrinsics/date_and_time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c index d536404a214..ff7204762da 100644 --- a/libgfortran/intrinsics/date_and_time.c +++ b/libgfortran/intrinsics/date_and_time.c @@ -117,9 +117,9 @@ gmtime_r (const time_t * timep, struct tm * result) TODO : - Check year boundaries. */ -#define DATE_LEN 8 +#define DATE_LEN 24 #define TIME_LEN 10 -#define ZONE_LEN 5 +#define ZONE_LEN 11 #define VALUES_SIZE 8 extern void date_and_time (char *, char *, char *, gfc_array_i4 *,