Hello kan;

On 08/27/15 09:00, Alexander Kabaev wrote:
Author: kan
Date: Thu Aug 27 14:00:23 2015
New Revision: 287206
URL: https://svnweb.freebsd.org/changeset/base/287206

Log:
   Repair sys/cdefs.h enough to be usable with GCC 5.x

   The __alloc_size and __alloc_align need to be defined to
   nothingness for lint, but the existing check is deficient
   and allows attributes with working __has_attrubute() to
   slip through.


AFAICT GCC hasn't added __has_attribute(), but if they did recently
that is great news.

Modified:
   head/sys/sys/cdefs.h

..


  #if !__GNUC_PREREQ__(2, 95)
@@ -371,24 +382,12 @@
  #define       __returns_twice
  #endif

-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
-#define        __alloc_size(x) __attribute__((__alloc_size__(x)))
-#else
-#define        __alloc_size(x)
-#endif
-

This surely got through in GCC's case through the __GNUC_PREREQ__.
Of course gcc 4.2 has neither attribute but clang has alloc_size
so I wonder why it hasn't affected the lint builds.

Just curiosity, the change is OK but it will be getting ugly if we
have to add all the new attributes in the !lint section.

Regards,

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

Reply via email to