Author: pfg
Date: Wed Apr  1 16:17:58 2015
New Revision: 280958
URL: https://svnweb.freebsd.org/changeset/base/280958

Log:
  Revert        r280449;
  Permit multiple arguments for the nonnull attribute.
  
  For the benefit of anyone that may be struggling to port
  FreeBSD to gcc 2.8 (or older) avoid using variadic macros.
  
  MFC   r280700 (partial);
  
  Bring new attribute:
  __result_use_check
  Causes a warning to be emitted if a caller of the function
  with this attribute does not use its return value. This is
  known in gcc as "warn_unused_result" but we considered the
  original naming unsuitable for an attribute.

Modified:
  stable/10/sys/sys/cdefs.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/sys/cdefs.h
==============================================================================
--- stable/10/sys/sys/cdefs.h   Wed Apr  1 12:42:26 2015        (r280957)
+++ stable/10/sys/sys/cdefs.h   Wed Apr  1 16:17:58 2015        (r280958)
@@ -40,6 +40,9 @@
  * Testing against Clang-specific extensions.
  */
 
+#ifndef        __has_attribute
+#define        __has_attribute(x)      0
+#endif
 #ifndef        __has_extension
 #define        __has_extension         __has_feature
 #endif
@@ -240,7 +243,7 @@
 #define __aligned(x)   __attribute__((__aligned__(x)))
 #define __section(x)   __attribute__((__section__(x)))
 #endif
-#endif
+#endif /* lint */
 
 #if !__GNUC_PREREQ__(2, 95)
 #define        __alignof(x)    __offsetof(struct { char __a; x __b; }, __b)
@@ -347,15 +350,17 @@
 #endif
 
 #if __GNUC_PREREQ__(3, 3)
-#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__)))
+#define __nonnull(x)   __attribute__((__nonnull__(x)))
 #else
-#define __nonnull(...)
+#define __nonnull(x)
 #endif
 
 #if __GNUC_PREREQ__(3, 4)
 #define        __fastcall      __attribute__((__fastcall__))
+#define        __result_use_check      __attribute__((__warn_unused_result__))
 #else
 #define        __fastcall
+#define        __result_use_check
 #endif
 
 #if __GNUC_PREREQ__(4, 1)
_______________________________________________
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