From patchwork Thu Jun 21 11:24:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 27978 Received: (qmail 41677 invoked by alias); 21 Jun 2018 11:24:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 41459 invoked by uid 89); 21 Jun 2018 11:24:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Subject: Re: [PATCH] time: Define _STRUCT_TIMESPEC in To: Zack Weinberg Cc: GNU C Library References: <20180621064654.2D7DA4289B0D0@oldenburg.str.redhat.com> From: Florian Weimer Message-ID: <21e4d5b7-f883-4722-0dcc-5e4228720fac@redhat.com> Date: Thu, 21 Jun 2018 13:24:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: On 06/21/2018 01:00 PM, Zack Weinberg wrote: > On Thu, Jun 21, 2018 at 2:46 AM, Florian Weimer wrote: >> After commit d76d3703551a362b472c866b5b6089f66f8daa8e ("Fix missing >> timespec definition for sys/stat.h (BZ #21371)"), sanitizer builds start >> to fail due to a conflicting definition of struct timespec in >> . Define _STRUCT_TIMESPEC, which is already checked in >> the kernel header, to support including after >> . > > Should it go the other way around as well? That is, if > _STRUCT_TIMESPEC is already defined, should we suppress our > definition? Hmm, sure, that would be possible. > Either way I think there should be a comment saying that linux/time.h > checks this macro. It's in generic code, so I wasn't sure if it was okay to refer to . But I can certainly add that. What about the attached patch? Thanks, Florian Subject: [PATCH] time: Define _STRUCT_TIMESPEC in To: libc-alpha@sourceware.org After commit d76d3703551a362b472c866b5b6089f66f8daa8e ("Fix missing timespec definition for sys/stat.h (BZ #21371)"), sanitizer builds start to fail due to a conflicting definition of struct timespec in . Use _STRUCT_TIMESPEC as the header file inclusion guard, which is already checked in the kernel header, to support including and in the same translation unit. 2018-06-21 Florian Weimer * time/bits/types/struct_timespec.h (_STRUCT_TIMESPEC): Define. diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index 644db9fdb6..5b77c52b4f 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -1,5 +1,6 @@ -#ifndef __timespec_defined -#define __timespec_defined 1 +/* NB: Include guard matches what uses. */ +#ifndef _STRUCT_TIMESPEC +#define _STRUCT_TIMESPEC 1 #include