Revision: 54121
http://brlcad.svn.sourceforge.net/brlcad/?rev=54121&view=rev
Author: caen23
Date: 2012-12-28 18:41:28 +0000 (Fri, 28 Dec 2012)
Log Message:
-----------
Suppress Clang warnings regarding offsetof
Modified Paths:
--------------
brlcad/trunk/include/bu.h
Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h 2012-12-28 16:57:46 UTC (rev 54120)
+++ brlcad/trunk/include/bu.h 2012-12-28 18:41:28 UTC (rev 54121)
@@ -1162,7 +1162,7 @@
* Files using BU_LIST_MAIN_PTR will need to include stddef.h
*/
#define BU_LIST_MAIN_PTR(_type, _ptr2, _name2) \
- ((struct _type *)(((char *)(_ptr2)) - (offsetof(struct _type, _name2) +
offsetof(struct bu_list, magic))))
+ ((struct _type *)(((char *)(_ptr2)) - (bu_offsetof(struct _type, _name2) +
bu_offsetof(struct bu_list, magic))))
/** @} */
@@ -2090,8 +2090,14 @@
/* FIXME - this is a temporary cast. The bu_structparse sp_offset member
* should be a size_t.
*/
+#ifndef offsetof
# define bu_offsetof(_t, _m) (size_t)(&(((_t *)0)->_m))
# define bu_offsetofarray(_t, _m) (size_t)((((_t *)0)->_m))
+#else
+# pragma clang diagnostic ignored "-Wextended-offsetof"
+# define bu_offsetof(_t, _m) (size_t)offsetof(_t, _m)
+# define bu_offsetofarray(_t, _m) (size_t)offsetof(_t, _m[0])
+#endif
/**
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits