On Sun, 19 Jun 2011, Ben Laurie wrote:

On 18/06/2011 18:45, Kostik Belousov wrote:
Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h        Sat Jun 18 13:54:36 2011        (r223261)
+++ head/sys/sys/param.h        Sat Jun 18 13:56:33 2011        (r223262)
@@ -319,4 +319,10 @@ __END_DECLS
 #define        member2struct(s, m, x)                                          
\
        ((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))

+/*
+ * Access a variable length array that has been declared as a fixed
+ * length array.
+ */
+#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+
 #endif /* _SYS_PARAM_H_ */

The "typeof" there should be "__typeof", most likely.

Hmm. Clang's own headers use __typeof__, it seems. gcc's docs also use
__typeof__.

gcc supports but __foo__ and __foo for most things.  The excessive
underscores in __foo are style bugs and are not used in FreeBSD if
possible.  (They are useless, unlike leading underscores which are
used to put identifiers in reserved namespaces.)  Unfortunately,
gcc doesn't actually document the alternative __foo form, at least
in gcc*.info, and it doesn't support the __foo form for a few identifiers
(notably for attributes).

typeof in the above is an error because it is in the application
namespace.  The above also has some style bugs.

Bruce
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to