public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] don't use C99 static array indices with older GCC versions
@ 2017-04-04  9:44 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-04-04  9:44 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3abc66ec6bf8c4312da413a62a5740a33edccaad

commit 3abc66ec6bf8c4312da413a62a5740a33edccaad
Author: avg <avg@FreeBSD.org>
Date:   Tue Apr 4 09:04:58 2017 +0200

    don't use C99 static array indices with older GCC versions
    
    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

Diff:
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-04  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  9:44 [newlib-cygwin] don't use C99 static array indices with older GCC versions Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).