bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] utimens: fix confusing arg type in internal func


From: Kamil Dudka
Subject: Re: [PATCH] utimens: fix confusing arg type in internal func
Date: Fri, 09 Apr 2021 09:50:55 +0200

On Thursday, April 8, 2021 2:30:42 AM CEST Paul Eggert wrote:
> Although the old code was technically correct, this was accidental
> and it understandably confused Coverity.  Reported by Ondrej Dubaj in:
> https://lists.gnu.org/r/bug-tar/2021-04/msg00000.html

The warning[-Wstringop-overflow=] reports you refer to come from GCC actually.

> * lib/utimens.c (update_timespec): Change arg type from ‘struct
> timespec *[2]’ (pointer to array of 2 pointers to timespecs) to
> ‘struct timespec **’ (pointer to pointer to the first timespec in
> an array of 2 timespecs).  Although the old code happened to be
> technically correct, it was misleading and confused Coverity.
> And though the type ‘struct timespec (**)[2]’ (pointer to pointer
> to array of 2 timespecs) would perhaps be more technically
> correct, it would be almost as confusing and would require changes
> elsewhere in this file; let’s quit while we’re ahead.

The change indeed eliminated the GCC warnings.  Thanks!

Kamil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]