From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36124 invoked by alias); 6 Sep 2017 12:52:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 36096 invoked by uid 89); 6 Sep 2017 12:52:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1461, H*r:sk:51.2017, reader X-HELO: mail-qt0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rfDBKzdzDStBd4tvi1cr+ch1o4o7tMV0RqDIxnQxkwY=; b=rNBagK42P6hB+apUvF7jd9QXk++uTGYzFeDHqM+UhzdC68hRml7ZqgZonItWzLmRh/ DjIgGE2bI60UGR2aCvQfSo9VdKipIijB7iY3yz0UssYERLroTpLQYyckkm+uD2/RC836 jFQnmaFH0BS34J51EbUuMhF+9z5xN5MI1sPseW9dOHnQd8Hgvej7WI2Wysx7pkZqQwv+ GE+Nr1sheWJBUy7FPm9mn8qpDYn1RrUA9v+mxoIPr3RSSzWdYaCz9a8KtX2NPMoMSgYQ l7lXY+ewHYPw9i5Sho3QO67AKHRGHZ3MK2iPSqv/NvBM89ECv3aSqrR8VRt/8XVsSclK Ds4A== X-Gm-Message-State: AHPjjUiemUrcnXvsF4LMmlGgFppfNYgznSWV/2N0izEknNG2cioeD05d lnsi2ng+38cMXAT5lcAeKw== X-Google-Smtp-Source: ADKCNb7YadtpC7/OPqMpqiiLqiVECeeRDpafMEqEfZ6tKB91xNpAx/WT6is6PW9bxPDSmLOaRBs34w== X-Received: by 10.200.43.188 with SMTP id m57mr3299253qtm.192.1504702349223; Wed, 06 Sep 2017 05:52:29 -0700 (PDT) Subject: Re: [PATCH 1/9] posix: Sync glob with gnulib [BZ #1062] To: Paul Eggert , libc-alpha@sourceware.org References: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> <1504643122-14874-2-git-send-email-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Message-ID: <3d1e0b00-accd-88d9-7867-56ae1aeee61d@linaro.org> Date: Wed, 06 Sep 2017 12:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00239.txt.bz2 On 05/09/2017 23:01, Paul Eggert wrote: > Adhemerval Zanella wrote: >> +/* Any distinct values will do here. >> + Undef any existing macros out of the way. */ >> +#ifndef DT_UNKNOWN >> +# define DT_UNKNOWN 0 >> +#endif >> +#ifndef DT_DIR >> +# define DT_DIR 1 >> +#endif >> +#ifndef DT_LNK >> +# define DT_LNK 2 >> +#endif > > The comment here does not match the code, as nothing is being undeffed. Instead of this change, how about the following? Indeed, I forgot to update the comments after the fix. > #if !defined _LIBC && !defined HAVE_STRUCT_DIRENT_D_TYPE > /* Any distinct values will do here. > Undef any existing macros out of the way. */ > # undef DT_UNKNOWN > # undef DT_DIR > # undef DT_LNK > # define DT_UNKNOWN 0 > # define DT_DIR 1 > # define DT_LNK 2 > #endif > > This makes it more clear to the casual reader that this code is for use only outside glibc. Also, it's more robust for hopefully only-hypothetical non-glibc platforms that define some DT_ symbols but not others, because it guarantees their uniqueness in that case. I installed the attached patch into Gnulib, along these lines. I do not have a strong preference here, I am ok with your approach and I will update my patch with this change. In fact I would prefer that all this boilerplate that is non required for glibc code to be on a specific header (maybe glob-gnulib.h or something), but we can think about it later.