diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-02-22 01:54:17 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-02-22 01:54:17 +0000 |
commit | 5f65fc0318ec2e218f6e521fc1849c186799f541 (patch) | |
tree | e1ee8f7faf49d032543a5d0d93a987ef3fa4e404 | |
parent | 5dbe33e3ee3615260036b2dc89bfd164b62a6296 (diff) | |
download | samba-5f65fc0318ec2e218f6e521fc1849c186799f541.tar.gz samba-5f65fc0318ec2e218f6e521fc1849c186799f541.tar.bz2 samba-5f65fc0318ec2e218f6e521fc1849c186799f541.zip |
Try to catch the compilers that don't handle immidiate structures as well as we
would like. We use them to initialise other struct (lookup) tables, so test
that as well.
Also try not to segfault during our snprintf tests - test both with a 0 len
buffer and without any buffer at all.
Andrew Bartlett
(This used to be commit 2d80ab7122f34d3bf31cddd26a63929f9c2ced77)
-rw-r--r-- | source3/configure.in | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/configure.in b/source3/configure.in index 6c2aae1872..90bf8a67c5 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -352,9 +352,15 @@ AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [ AC_TRY_COMPILE([ #include <stdio.h>], [ - #define X_FOOBAR(x) ((FOOBAR) { x }) typedef struct {unsigned x;} FOOBAR; - FOOBAR f = X_FOOBAR(1); + #define X_FOOBAR(x) ((FOOBAR) { x }) + #define FOO_ONE X_FOOBAR(1) + FOOBAR f = FOO_ONE; + static struct { + FOOBAR y; + } f2[] = { + {FOO_ONE} + }; ], samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)]) if test x"$samba_cv_immediate_structures" = x"yes"; then @@ -990,6 +996,11 @@ void foo(const char *format, ...) { char buf[5]; va_start(ap, format); + len = vsnprintf(buf, 0, format, ap); + va_end(ap); + if (len != 5) exit(1); + + va_start(ap, format); len = vsnprintf(0, 0, format, ap); va_end(ap); if (len != 5) exit(1); |