Date: Wed, 22 Feb 2017 17:20:18 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314101 - head/sys/sys Message-ID: <201702221720.v1MHKIRG076268@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Wed Feb 22 17:20:18 2017 New Revision: 314101 URL: https://svnweb.freebsd.org/changeset/base/314101 Log: 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 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Wed Feb 22 17:13:00 2017 (r314100) +++ head/sys/sys/cdefs.h Wed Feb 22 17:20:18 2017 (r314101) @@ -349,6 +349,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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702221720.v1MHKIRG076268>