From patchwork Tue Nov 28 10:25:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 119817 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1514342qgn; Tue, 28 Nov 2017 02:25:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMa27SaY4JdUCDpOyWEKq/jglxU57OBkZfmNwxOCVQdcVUkYKdPaiPOue/O4kSlBjahBO3k1 X-Received: by 10.101.65.141 with SMTP id a13mr673151pgq.203.1511864744312; Tue, 28 Nov 2017 02:25:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511864744; cv=none; d=google.com; s=arc-20160816; b=BxxNi6v5I/DHB/fddGDSFk7U5qehqpmJPezgTr7f2vS69yBOpCxWPHQ4OFT2oo9L51 KLCRvkCqYJwzfa7I0FdN76sEmQzfJeMstoBdMWJ51+U5K5tGdE1Es6za92FzGH60+7M/ ukZTl9O/Tr93C0AgtFUJRMudVrsux7qGq5KpM7ZdkqpQi5V/oB2xQpyPpvzwE7rCbEze LOgl82OtA5uS61h8KpgiMYaSjOwuOh0STXsiAJAEJTiFTbWDeghgY5nKdlZHi4NK2kqK 3ZrLx50IRWTcN5U+brDeWi9gDdtFmRyxrm1Y1pBKZD3aFJjCWz9qkzHZpG5g5doQyH3O HQ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=L7437JJvPuXFAce0UiYkzR84XAKqLxcJcbuHvEyeEEQ=; b=QwMyxipkYk8NhqxfUr2+Zqa4l9SCIfWlPdo23EmECZBkxxi/XetQlA5AVTI1i0NTWu +80St29N9oAVYjWdmJdfFh7Y/AhFs7h2SieLYhV/pX1qTr83W5ZkYpBCnBja2FvFB0Om Ijo8gxtLuBhG/p9+qeoVgXExZ08fxWUGiDd9xvaU1c6LVXUicSo4c89/6JynmH8kEWP2 LjYt5W17/JCxW+GKoPZNDqIQMN6SjwD9bKefAKe9YpDW8mj+6WgrmALVqlaOzP+WD/T3 8bLnHNGFqfqnsOiYuisDPlz8Ub09HFBCzHtfMGOgIAKGEaUtsu9AuhXtsog7NlT2GmW5 5xyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qQIzm3of; spf=pass (google.com: domain of newlib-return-15383-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15383-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t7si24490730pgs.601.2017.11.28.02.25.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2017 02:25:44 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-15383-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qQIzm3of; spf=pass (google.com: domain of newlib-return-15383-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15383-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=Pv9M3Q7DT+JPEKAQMTwiSsXBrO1Nl8PVTloySARsi5lqtNjfE8Rer eWUOdVLFLgTrPDwN9ZAtF00xLEHLvEqX7OuQGGcsW4trYW9GYsqwpV06urp06a5f +i0rCQjefklVOGs8uqfWjVzVJm8LJ7VX2IDzlhaBG62To/Jr8pvZJ0= 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:from:to:subject:date:message-id; s=default; bh=Els1cQNzKzrtMGkaWXDam2s7T5Y=; b=qQIzm3ofjmCpsJnRFe/TrwIcOn5f LHJjsyFgsfv5Y/dwuHlb7wffUxS5G20evR1dVZnS0//A8zA/5c9386csJS3Kb4/s MDR+6BLfz9JWo+QP1Ih+IOIL0roFRwDLDA0XXyGtZYtB216OwOTgN7le8PM/zFDm yhfgixIKuAroDzE= Received: (qmail 47784 invoked by alias); 28 Nov 2017 10:25:35 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 47709 invoked by uid 89); 28 Nov 2017 10:25:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=2827 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 10:25:33 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A598882FF for ; Tue, 28 Nov 2017 10:25:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-11.rdu2.redhat.com [10.10.120.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99F2360BE5 for ; Tue, 28 Nov 2017 10:25:31 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] Make __nonnull macro compatible with glibc Date: Tue, 28 Nov 2017 04:25:23 -0600 Message-Id: <20171128102523.11808-1-yselkowi@redhat.com> This form allows for multiple arguments, e.g. __nonnull((1,2)). Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/pthread.h | 4 ++-- newlib/libc/include/stdlib.h | 2 +- newlib/libc/include/string.h | 2 +- newlib/libc/include/sys/cdefs.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- 2.15.0 diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h index 516131d83..fb2fa93d8 100644 --- a/newlib/libc/include/pthread.h +++ b/newlib/libc/include/pthread.h @@ -171,9 +171,9 @@ int _EXFUN(pthread_setschedprio, (pthread_t thread, int prio)); #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ #if __GNU_VISIBLE -int pthread_getname_np(pthread_t, char *, size_t) __nonnull(2); +int pthread_getname_np(pthread_t, char *, size_t) __nonnull((2)); -int pthread_setname_np(pthread_t, const char *) __nonnull(2); +int pthread_setname_np(pthread_t, const char *) __nonnull((2)); #endif #if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 968367f22..af5bfecf1 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -282,7 +282,7 @@ int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); #endif /* !__CYGWIN__ */ #if __POSIX_VISIBLE >= 200112 -int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t)); +int _EXFUN(__nonnull ((1)) posix_memalign,(void **, size_t, size_t)); #endif char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h index 9c536f35f..57db7742b 100644 --- a/newlib/libc/include/string.h +++ b/newlib/libc/include/string.h @@ -169,7 +169,7 @@ int _EXFUN(strverscmp,(const char *, const char *)); sure here. */ #if __GNU_VISIBLE && !defined(basename) # define basename basename -char *_EXFUN(__nonnull (1) basename,(const char *)) __asm__(__ASMNAME("__gnu_basename")); +char *_EXFUN(__nonnull ((1)) basename,(const char *)) __asm__(__ASMNAME("__gnu_basename")); #endif #include diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index 8ce14b68e..db5f2bf2d 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -397,7 +397,7 @@ #endif #if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) +#define __nonnull(x) __attribute__((__nonnull__ x)) #define __nonnull_all __attribute__((__nonnull__)) #else #define __nonnull(x)