From: Douglas Bagnall Date: Fri, 7 Jul 2023 00:50:13 +0000 (+1200) Subject: configure: ensure sizeof(int) >= 4 X-Git-Tag: talloc-2.4.1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e2ec1d8bec3285a0f6c075bddcab161ac5e9db;p=thirdparty%2Fsamba.git configure: ensure sizeof(int) >= 4 There are multiple places we make this assumption. For example, in source3/lib/tldap.c, we have this line if (ld->msgid == 2147483647) { where ld->msgid is an int. And in librpc/idl/security.idl we have several lines like: const int SEC_MASK_GENERIC = 0xF0000000; In lib/replace/inet_pton.c and inet_ntop.c we have /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ but no attempt to enforce that as far as I can see, until now. Signed-off-by: Douglas Bagnall Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Jul 11 22:44:15 UTC 2023 on atb-devel-224 --- diff --git a/lib/replace/wscript b/lib/replace/wscript index f5c597c04c2..199e636aa02 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -184,6 +184,10 @@ def configure(conf): conf.CHECK_TYPE('blkcnt_t', 'long', headers='sys/types.h sys/stat.h unistd.h') conf.CHECK_SIZEOF('bool char int "long long" long short size_t ssize_t') + sizeof_int = conf.env["SIZEOF_INT"] + if sizeof_int < 4: + conf.fatal(f"Samba won't work with int of size {sizeof_int} (requires >= 4)") + conf.CHECK_SIZEOF('int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t') conf.CHECK_SIZEOF('void*', define='SIZEOF_VOID_P') conf.CHECK_SIZEOF('off_t dev_t ino_t time_t')