[tlbuild] lcdf-typetools-2.85 doesn't compile with gcc-3.4.2 on old FreeBSD-5

Nikola Lečić nikola.lecic at anthesphoria.net
Mon Feb 7 15:50:44 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Peter Breitenlohner <peb at mppmu.mpg.de> wrote
  in <alpine.LNX.2.00.1102071338290.31680 at pcl321.mppmu.mpg.de>
  on Mon, 7 Feb 2011 14:14:10 +0100 (CET):

> it seems your g++ chokes on
>      enum {
>  	MEMO_SPACE = offsetof(memo_t, real_data)
>      };
> that was introduced between 2.83 and 2.85 because the offset of
> real_data now depends on HAVE_STRING_PROFILING.
> 
> I wonder why this isn't
>     offsetof(struct memo_t, real_data)
> 
> I have no problem with g++-3.4.6, but I see that my (linux) stddef.h
> from 3.3.3 has
>      #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
> whereas 3.4.6 has
>      #ifndef __cplusplus
>      #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
>      #else
>      #define offsetof(TYPE, MEMBER)                                  \
>        (__offsetof__ (reinterpret_cast <size_t>                      \
>                       (&reinterpret_cast <const volatile char &>     \
>                        (static_cast<TYPE *> (0)->MEMBER))))
>      #endif
> 
> Can you please have a look and tell us what is your offsetof (for
> C++).

On FreeBSD-5.5 (src/sys/sys/cdefs.h) I have:

/*
 * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
 * require it.
 */
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))

cf.
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/cdefs.h?rev=1.84.2.1;content-type=text%2Fx-cvsweb-markup

- -- 
Nikola Lečić = Никола Лечић
fingerprint : FEF3 66AF C90E EDC3 D878  7CDC 956D F4AB A377 1C9B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iJwEAQEDAAYFAk1QBskACgkQ/MM/0rYIoZgyrgP/R99FrgxP7l/2HtAAv1oAptTF
fQ93rtGBJxJUmRmzorGmtW1t+nMAulvDV0Umk+gz5KxAP7tblwxD0Fqc9FZ6xMrp
Lo2+UIjVfYOW/yN9RFrRjAIhz9N8bjtTEHPkkeyILTxez4xT6SOOWpABpwmzMTQu
D8BEeti+Q84hKlY9g84=
=VHVM
-----END PGP SIGNATURE-----



More information about the tlbuild mailing list