From f749a64280051663f04fa5dfd11a50e3d4ce4e77 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Tue, 14 Jun 2016 22:29:34 -0700 Subject: cmake: Detect proper large file defines even with -Wno-error Without this change large file support was detected as available even when it was not without additional flags on 32 architectures. As a result mergecap and other programs are built without large file support causing mergecap not being able to write files bigger than 2GB on i386 systems. This used to work properly with autotools builds, but not with CMake ones. Change-Id: Ibfd043342b2a48310d2ac9d760e6404a701c5808 Reviewed-on: https://code.wireshark.org/review/15937 Petri-Dish: Balint Reczey Tested-by: Petri Dish Buildbot Reviewed-by: Balint Reczey --- cmake/TestFileOffsetBits.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmake/TestFileOffsetBits.c') diff --git a/cmake/TestFileOffsetBits.c b/cmake/TestFileOffsetBits.c index ac0e51e225..882abb4cfc 100644 --- a/cmake/TestFileOffsetBits.c +++ b/cmake/TestFileOffsetBits.c @@ -8,11 +8,17 @@ #include +/* detect failure even with -Wno-error on command line */ +#pragma GCC diagnostic error "-Werror" + int main(int argc, char **argv) { /* Cause a compile-time error if off_t is smaller than 64 bits */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ]; + /* silence unused errors */ + (void)off_t_is_large; + (void)argc; + (void)argv; return 0; } - -- cgit v1.2.3