From patchwork Sat Jun 4 00:11:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 630107 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 3rM1bd1Kk9z9t9N for ; Sat, 4 Jun 2016 10:11:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=MQfPYUHg; 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:to:from:subject:cc:message-id:date :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=fabbpGB+h8k0IKVVwV8+izxSHcllR5tmnvCWc8bH+oDFb697L3CHQ 5lBorv3KL2xA3M2siCQplHbOk2kfpB1SDJ8Ky6j2MQoIT7lhK1X0xcqgXjlmtFY/ WWMizIDW0r3GmOWUHk1jRuet9Z5OgomtuIimJlAQ80pL4pXwkM4zzI= 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:to:from:subject:cc:message-id:date :mime-version:content-type:content-transfer-encoding; s=default; bh=7jO3MY22ibt/qcTgq1qheceABTA=; b=MQfPYUHgLoWMIi32GG7kLE4K9tkI ajqjaR2M3zGpmevnFrWxKF4blO89z7lYTXnGwwzXY2XISk6upcKSPP3UkzIOOzCA csq+5pGXtuYTW6r4J4PMQgnXnEnqHyy+CJZ6Q0lLR41ApC+k3hTY4nPxECmMTMZg 0ynWEMjJaukEvvA= Received: (qmail 117175 invoked by alias); 4 Jun 2016 00:11:30 -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 117126 invoked by uid 89); 4 Jun 2016 00:11:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=1027, HContent-Transfer-Encoding:8bit X-HELO: mail-qk0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:organization:cc:message-id:date :user-agent:mime-version:content-transfer-encoding; bh=T83743nc57gML6+vl9oQJBr8NUi2KSUAorijsC93e94=; b=ewSAtY3zInvYlz+PtY7eSFwap7rM8CbYHouwqbIhmgXNXBb+AvH/N8CSPCaH3Ia3SU TcwmTd/wwxsgSsrgv8Y5LNIZsw7GXz3+4AmHqXwmyf0gUsXfbR+iTLfP0HuyF2vdzXLS MYumgXJtQ2oTNn8hU7GmCgOdu/TS00GC98yEyJLTC5ZkPPF7fVSX1M+SY3XB03X1MNX5 2sjcLIUcrTUJNsarbnpa7iAFeIgpTLrMHz2diB6AaTrkG55TObChA8ZvTPVvUOc1PgbG U5zsTFcO75tNsPOG7f49D/BhCOK3RJAnzbwjIWAzUeF3lZGtRufYEpT+VdNGMU5Au+c4 Q8VA== X-Gm-Message-State: ALyK8tIJRu5dq/r8nWsiYm/dmn8h1G0cElLvHa3wgdNoiS2+FM43/0n4u7506YXkeJYLvYlH X-Received: by 10.55.207.149 with SMTP id v21mr6072750qkl.195.1464999085240; Fri, 03 Jun 2016 17:11:25 -0700 (PDT) To: GNU C Library From: Carlos O'Donell Subject: [COMMITTED] Fix include/wchar.h for C++ Cc: "Joseph S. Myers" Message-ID: <57521CAA.4010800@redhat.com> Date: Fri, 3 Jun 2016 20:11:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 It is not possible, at least not initially to me, to use typeof in C++ to express a function declaration. The g++ frontend disallows what it believes is a conversion from 'int' to the type. In file included from /usr/include/c++/5.3.1/cwchar:44:0, from /usr/include/c++/5.3.1/bits/postypes.h:40, from /usr/include/c++/5.3.1/bits/char_traits.h:40, from /usr/include/c++/5.3.1/string:40, from /usr/include/c++/5.3.1/stdexcept:39, from /usr/include/c++/5.3.1/array:38, from /usr/include/c++/5.3.1/tuple:39, from /usr/include/c++/5.3.1/functional:55, from /usr/include/c++/5.3.1/thread:39, from tst-thread-quick_exit.cc:19: ../include/wchar.h:105:23: error: invalid conversion from ‘wchar_t* (*)(wchar_t*, wchar_t, size_t) throw () {aka wchar_t* (*)(wchar_t*, wchar_t, long unsigned int) throw ()}’ to ‘int’ [-fpermissive] extern typeof (wmemset) __wmemset; ^ ../include/wchar.h:105:25: error: expected ‘,’ or ‘;’ before ‘__wmemset’ extern typeof (wmemset) __wmemset; ^ This change fixes this by avoiding typeof entirely and declaring the function using the expected prototype. No regressions on x86_64. Committed as an obvious fix. The include/wchar.h header is only for internal build uses and therefore is not ever seen by any external users and needs no bug #. This change is needed for a followup C++ program that uses threads and causes the above failure. diff --git a/include/wchar.h b/include/wchar.h index 0f33d09..96b0438 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -102,7 +102,7 @@ extern int __wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; libc_hidden_proto (__wcscoll) libc_hidden_proto (wcspbrk) -extern typeof (wmemset) __wmemset; +extern wchar_t *__wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; extern wchar_t *__wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; libc_hidden_proto (wmemchr)