On Sun, Oct 17, 2010 at 3:18 AM, Magnus Fromreide <[email protected]>wrote:
> On Sat, 2010-10-16 at 23:52 +0200, Magnus Fromreide wrote:
> > I found this in r19458
> >
> > #if defined(__GNUC__)
> > typedef unsigned long netsnmp_uintptr_t;
> > #else
> > typedef uintptr_t netsnmp_uintptr_t;
> > #endif
> > #ifndef __cplusplus
> > enum {
> > netsnmp_compile_time_uintptr_t_size_check
> > = sizeof(struct { int:-!(sizeof(netsnmp_uintptr_t) >= sizeof(void*));
> })
> > };
> > #endif
> >
> > and ended up very confused. I would like to see a motivation for this
> > oddity. GNU C do define uintptr_t in inttypes.h and autoconf checks for
> > it and defines it if needed so what is the point of netsnmp_uintptr_t?
>
> Oh yes, this patch additionally breaks builds on Solaris 10 using
> Sun C 5.7.
Regarding the motivation for introducing netsnmp_uintptr_t: you should know
that not all platforms supported by Net-SNMP use autoconf - the exception is
Win32 + MSVC. For this platform there was the choice between either
introducing a typedef or duplicating the size check.
Regarding including <inttypes.h>: please also keep in mind that the header
<net-snmp/library/tools.h> is already used in some configure tests before
net-snmp-config.h has been generated. Which means: before configure had a
chance to define macros like HAVE_INTTYPES_H.
Regarding Solaris 10 + Sun C 5.7: specifying "breaks builds" without any
further information is not very helpful. While ANSI C allows to leave out
the variable name when declaring a bitfield, maybe the Sun C 5.7 compiler
doesn't support this. Does changing "int:-!" into "int dummy:-!" help ?
Bart.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders