From patchwork Sun Nov 27 17:37:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 699724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tRcT843Qvz9t2n for ; Mon, 28 Nov 2016 04:37:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="p8xOcyvM"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=Amo/E1z 6RSmxWxHJxpmfAqg0mkPPwUvr8hIs3OGT1qkPV48M0ChVyTfmsfpNlN+4Edx20Ea DPzB4ZP/YvAgtq8XS51H0l8+DEtLfXArqomAzBcEvprtLPmG/gt/KPRUStohMF6G InTlLn9n1nTtWYxogYtPIrok4E8Yd8BozAWU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=Ao7P10AwgdMJp lvs7EH9xoIawTA=; b=p8xOcyvMVjbqVBbObZHYUxbuufzq9JTXSC3jGuXkBSN5J 131BHvF4w/zYxupZyrpScqf05DoL6GnGYJdmkFsNMs1qbXWBJvirLKeB1KFjBOjg cEZB2a23Qu8G9MJPHoTcyqSjv3AjdUHURojMRyBWvJoiveo7IDr3OA2/3jepKo= Received: (qmail 45277 invoked by alias); 27 Nov 2016 17:37:26 -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 45262 invoked by uid 89); 27 Nov 2016 17:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mailbackend.panix.com X-Gm-Message-State: AKaTC0269s/dr+/5QK7aWskEVxeQoVsz4dzZizyP0Mb080eb951EY1iu7id2HVO7QUtB7surYLWt3LfCjtIE6g== X-Received: by 10.28.150.75 with SMTP id y72mr16857546wmd.47.1480268232569; Sun, 27 Nov 2016 09:37:12 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20161127065030.GX21655@vapier.lan> References: <2bd51680-f831-14a3-ed52-ceeec6eb9709@panix.com> <20161127065030.GX21655@vapier.lan> From: Zack Weinberg Date: Sun, 27 Nov 2016 12:37:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Always suppress libc-internal declarations for C++ code. To: GNU C Library On Sun, Nov 27, 2016 at 1:50 AM, Mike Frysinger wrote: > On 21 Nov 2016 12:42, Zack Weinberg wrote: >> This flushed out some minor problems: test-skeleton.c uses uintptr_t >> but wasn't including > > seems like this should be installed as obvious by itself Done (patch appended) >> libio.h tested _GNU_SOURCE instead of __USE_GNU in one place. > > makes sense regardless too Also done > a quick grep shows fnmatch.h has a similar error Isn't fnmatch.h shared with gnulib? I don't feel like I understand the constraints on code shared with gnulib, certainly not enough to call it "obvious." Also, some of the conditionals in there don't make sense to me ("#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE" -- what's that even supposed to do?) zw * libio/libio.h: Use __USE_GNU, not _GNU_SOURCE, in a conditional. * test-skeleton.c: Include stdint.h to ensure uintptr_t is available. diff --git a/libio/libio.h b/libio/libio.h index efd09f1..f4ead83 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -353,7 +353,7 @@ typedef int __io_seek_fn typedef int __io_close_fn (void *__cookie); -#ifdef _GNU_SOURCE +#ifdef __USE_GNU /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; diff --git a/test-skeleton.c b/test-skeleton.c index fa457be..154096f 100644 --- a/test-skeleton.c +++ b/test-skeleton.c @@ -33,6 +33,7 @@ #include #include #include +#include /* The test function is normally called `do_test' and it is called with argc and argv as the arguments. We nevertheless provide the