From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120003 invoked by alias); 4 Apr 2017 07:25:31 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 119903 invoked by uid 89); 4 Apr 2017 07:25:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=421, Hx-languages-length:1084, avg, sponsored X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 07:25:29 +0000 Received: from [88.198.220.131] (helo=sslproxy02.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1cvIWV-0002tf-ID; Tue, 04 Apr 2017 09:05:03 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cvIWV-0002Sw-5r; Tue, 04 Apr 2017 09:05:03 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 4B46A2A166D; Tue, 4 Apr 2017 09:05:43 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id s8kReJRheG9s; Tue, 4 Apr 2017 09:05:43 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id C77B72A1667; Tue, 4 Apr 2017 09:05:42 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id m46tt0_7axVZ; Tue, 4 Apr 2017 09:05:42 +0200 (CEST) Received: from huber-linux.eb.localhost (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTP id A2DF52A166D; Tue, 4 Apr 2017 09:05:42 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Cc: avg Subject: [PATCH 7/8] don't use C99 static array indices with older GCC versions Date: Tue, 04 Apr 2017 07:25:00 -0000 Message-Id: <1491289499-30548-8-git-send-email-sebastian.huber@embedded-brains.de> In-Reply-To: <1491289499-30548-1-git-send-email-sebastian.huber@embedded-brains.de> References: <1491289499-30548-1-git-send-email-sebastian.huber@embedded-brains.de> X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00255.txt.bz2 From: avg For example, the FreeBSD GCC (4.2.1) has a spotty support for that feature. If the static keyword is used with an unnamed array parameter in a function declaration, then the compilation fails with: error: static or type qualifiers in abstract declarator The feature does work if the parameter is named. So, the restriction introduced in this commit can be removed when all affected function prototypes have the workaround. MFC after: 1 week Sponsored by: Panzura --- newlib/libc/include/sys/cdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index fa1692c..280aefd 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -369,6 +369,7 @@ * void bar(int myArray[__min_size(10)]); */ #if !defined(__cplusplus) && \ + (defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \ (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901)) #define __min_size(x) static (x) #else -- 1.8.4.5