From patchwork Wed Dec 9 16:20:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Turner X-Patchwork-Id: 41348 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE3483971839; Wed, 9 Dec 2020 16:20:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE3483971839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607530820; bh=VXWRTAG5/jg1YiJS3ZJjDDhyXipV29JSGseLwVw2q3U=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=d2DDMhPFK1XlwsXr6pyTyy8XGoTmFZq2OHozUDP/M1ABjK7JDrSB1vbtwS81I10zk yUnvsd1tokbfl7N51bzHGBRkY8KhrouvsSyPtDrgLEgxKSrrnIEbgSLX3INFju/ARN kpO+4arGJYh9r7iCwE6FUafYVF/rg8Dpt2KTTc1g= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by sourceware.org (Postfix) with ESMTPS id 46F26386F802 for ; Wed, 9 Dec 2020 16:20:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 46F26386F802 Received: by mail-qv1-xf2e.google.com with SMTP id j13so829877qvi.8 for ; Wed, 09 Dec 2020 08:20:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VXWRTAG5/jg1YiJS3ZJjDDhyXipV29JSGseLwVw2q3U=; b=NSl/WOsYsXpN+4JmYGVaffupuO2xl66BW3Xqv8tLKc2bzMT2cFlcpYOdS8fQyzThbU uh9D8TBgpuFVMq69/IZ+JftZ7QWk2r7opwkfCm/+hocLPC+AUjJBVgPQoCwsx/Qax1VV mj/q6JXCqZGNyQQoCTbwGOdIzF3Q9yhdJiGo6a8v575nyMIr+XxuhxlU+3hB4u8Wgq59 5UZGB01dz+fGsJ9Gbh0N3FKNgjjbiMdCGnSuv7IiByIlBda3gzj5QJ5fbR6QjQaRAvxW IZzU9g+TB1OpS/5+b+892/DY7DZOHujXOzkONaaaGitvGpP6R8SmKKGBf+ncF9SSHwKL 6yqg== X-Gm-Message-State: AOAM532pAgzXKjPPxP3B7+fk6iPMUJebP1ZBlrO6Ev75NkZOuyWPRETL dQvs78ScopnmG5fYG7dVSdgV7Ylf9vLHAQ== X-Google-Smtp-Source: ABdhPJzZ1eghffB8mcrOMvyIo3KePP/wcY94iBvBA1Fd4axIGgo/kHiJ19BKbRx9vQTD7NJJAJFY5g== X-Received: by 2002:ad4:524d:: with SMTP id s13mr4173789qvq.19.1607530817686; Wed, 09 Dec 2020 08:20:17 -0800 (PST) Received: from localhost ([208.104.103.123]) by smtp.gmail.com with ESMTPSA id u5sm1355725qka.106.2020.12.09.08.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Dec 2020 08:20:17 -0800 (PST) To: libc-alpha Subject: [PATCH] alpha: Remove anonymous union in struct stat [BZ #27042] Date: Wed, 9 Dec 2020 11:20:08 -0500 Message-Id: <20201209162008.2064091-1-mattst88@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matt Turner via Libc-alpha From: Matt Turner Reply-To: Matt Turner Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is clever, but it confuses downstream detection in at least zstd and GNOME's glib. zstd has preprocessor tests for the 'st_mtime' macro, which is not provided by the path using the anonymous union; glib checks for the presence of 'st_mtimensec' in struct stat but then tries to access that field in struct statx (which might be a bug on its own). --- .../unix/sysv/linux/alpha/bits/struct_stat.h | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/bits/struct_stat.h b/sysdeps/unix/sysv/linux/alpha/bits/struct_stat.h index 1c9b4248b8..dddc5fb5a0 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/struct_stat.h @@ -27,26 +27,13 @@ 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of - this header in strictly standard-compliant sources special. - - Use neat tidy anonymous unions and structures when possible. */ + this header in strictly standard-compliant sources special. */ #ifdef __USE_XOPEN2K8 -# if __GNUC_PREREQ(3,3) -# define __ST_TIME(X) \ - __extension__ union { \ - struct timespec st_##X##tim; \ - struct { \ - __time_t st_##X##time; \ - unsigned long st_##X##timensec; \ - }; \ - } -# else -# define __ST_TIME(X) struct timespec st_##X##tim -# define st_atime st_atim.tv_sec -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# endif +# define __ST_TIME(X) struct timespec st_##X##tim +# define st_atime st_atim.tv_sec +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec #else # define __ST_TIME(X) \ __time_t st_##X##time; \