[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib
On Sat, Jun 26, 2010 at 01:32:05AM +0200, Joerg Sonnenberger wrote:
> On Fri, Jun 25, 2010 at 11:54:32PM +0200, Alistair Crooks wrote:
> > Even in C99, the "%lu" method will work unless size_t is bigger than
> > unsigned long *and* the value being printed exceeds ULONG_MAX, which
> > is unlikely to happen in practice.
Please get the attributions right - I was quoting that text.
> Actually, it doesn't. This method breaks as soon as size_t != u_long and
> might only work in a few edge cases like the size_t being the last
> argument and the byte order is Little Endian. This is worse because IIRC
> Microsoft decided to use IL32LLP64 or something similarly fancy.
Can you give us a reference to this, please?
> A more portable approach with autoconf can be found in pkg_install, look
> for MISSING_SIZE_T_SUPPORT and the corresponding AC_CHECK_SIZEOF calls
> in configure.ac.
Hmmm, I see this in configure.ac -
AC_CHECK_SIZEOF(size_t, [#include <stdlib.h>])
case $host in
Define to 1 if the `z' modifider for printf is missing.
# define PRIzu "zu"
#elif SIZEOF_SIZE_T == SIZEOF_INT
# define PRIzu "u"
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define PRIzu "lu"
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define PRIzu "llu"
# errror "Unknown size_t size"
Not quite what I'd been expecting, though, from the glowing description
Am I missing a revision of that file or something? It took me ages to
find it, since I was looking under src/external first of all - and cvs
status does say it's up to date.
Main Index |
Thread Index |