Subject: bug#71456: closed (Re: [bug-diffutils] bug#71456: compilation error in function 'same_file')

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 11 Jun 2024 16:14:02 +0000

Your bug report

#71456: compilation error in function 'same_file'

which was filed against the diffutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71456: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71456
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug-diffutils] bug#71456: compilation error in function 'same_file'
From: Paul Eggert <[email-masked]>
To: Bruno Haible <[email-masked]>
Cc: [email-masked]
Date: Tue, 11 Jun 2024 09:13:22 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks, I installed the attached.
From a9cca434611ee2293915110c74dc2c53ed4e58fd Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 11 Jun 2024 09:12:06 -0700
Subject: [PATCH] maint: port to birthtime platforms

Problem reported by Bruno Haible <https://bugs.gnu.org/71456>.
* src/system.c (same_file): Fix typo on platforms with birthtime.
---
 src/system.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/system.c b/src/system.c
index 8d8250e..1dcbd93 100644
--- a/src/system.c
+++ b/src/system.c
@@ -70,8 +70,8 @@ same_file (struct stat const *s, struct stat const *t)
      || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC \
      || (defined _WIN32 && ! defined __CYGWIN__))
   /* If either file has a birth time, comparing them is definitive.  */
-  timespec sbirth = get_stat_birthtime (s);
-  timespec tbirth = get_stat_birthtime (t);
+  struct timespec sbirth = get_stat_birthtime (s);
+  struct timespec tbirth = get_stat_birthtime (t);
   if (0 <= sbirth.tv_nsec || 0 <= tbirth.tv_nsec)
     return timespec_cmp (sbirth, tbirth) == 0;
 #endif
-- 
2.43.0

Subject: compilation error in function 'same_file'
From: Bruno Haible <[email-masked]>
To: [email-masked]
Date: Sun, 09 Jun 2024 23:52:28 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Compiling the current git master on
  - macOS
  - FreeBSD
  - NetBSD
  - Cygwin
  - mingw
  - MSVC

I get a compilation error:

  CC       system.o
../../src/system.c: In function 'same_file':
../../src/system.c:73:3: error: unknown type name 'timespec'; use 'struct' keyword to refer to the type
   73 |   timespec sbirth = get_stat_birthtime (s);
      |   ^~~~~~~~
      |   struct 

or

  CC       system.o
../../src/system.c:73:3: error: must use 'struct' tag to refer to type 'timespec'
  timespec sbirth = get_stat_birthtime (s);
  ^

To me, it looks like a regression in commit 1fa953a0c415cc65d0afdae2c9de0ad2bd2944eb.

Bruno