From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101148 invoked by alias); 21 Nov 2017 21:37:36 -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 101138 invoked by uid 89); 21 Nov 2017 21:37:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=courtesy, H*RU:sk:mailbac, Hx-spam-relays-external:sk:mailbac, H*F:D*panix.com X-HELO: mailbackend.panix.com X-Gm-Message-State: AJaThX7EjMrxB8vb2tPYmD/WIStvukQV0vUvlv6uAl9ZSBqZ3QlgqAGr FhVAt154awdGCi1IQi1FW0UOBOMK2HDzaPvswiA= X-Google-Smtp-Source: AGs4zMbY6q+YEH3jHjOd2c7BmoPkXUlsvFYCG6yrYW2VX1DhxyZtikZgbF+bF5fog7c29APQCa+h5C3RmFuLB8tNMF0= X-Received: by 10.202.78.151 with SMTP id c145mr2551847oib.42.1511300252821; Tue, 21 Nov 2017 13:37:32 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4d7143bb-2ee9-2be9-a16f-e16bf5d0047b@gmail.com> References: <797b60f7-1bd0-2b05-c25b-385ea3b04e68@redhat.com> <4d7143bb-2ee9-2be9-a16f-e16bf5d0047b@gmail.com> From: Zack Weinberg Date: Tue, 21 Nov 2017 21:37:00 -0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: nonstrings in Glibc To: Martin Sebor Cc: Florian Weimer , "Carlos O'Donell" , GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-11/txt/msg00756.txt.bz2 On Tue, Nov 21, 2017 at 4:20 PM, Martin Sebor wrote: > > I see two struct dirent in my Glibc build on x86_64: one in > bits/dirent.h and another in sysdeps/unix/sysv/linux/bits/dirent.h. > AFAICT, the first one is the one that's installed and the second > one is used internally within Glibc. Did I get that right? No, that's not right. The top-level bits directory contains _fallback_ bits headers, to be used only if no sysdeps directory overrides them; I don't know why it's in the top level instead of in sysdeps/generic (which is where you'd expect it to be) but it's probably something horrible to do with the include search path. On Linux-based configurations, sysdeps/unix/sysv/linux/bits/dirent.h should be both installed and used internally. > Should > one of these be annotated with attribute nonstring? (POSIX requires > d_name to be nul-terminated and there are assumptions in Glibc that > rely on it being so, such as the _D_EXACT_NAMLEN() macro, that > trigger the non-string warning if I annotate the latter.) If POSIX requires d_name to be nul-terminated, then I think it's safe to say that attribute nonstring is not appropriate for it (assuming I understand the point of attribute nonstring, anyway, which I only know about courtesy this thread). zw