ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] rev 50749: /trunk/ /trunk/: CMakeLists.txt

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 23 Jul 2013 11:57:03 -0700
On Jul 22, 2013, at 7:00 AM, Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> wrote:

> I try also in my Ubunux box (12.04) with clang 3.0 ( Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0) Target: x86_64-pc-linux-gnu Thread model: posix )
> 
> and i have the following error when i try to build with clang :
> 
> [  4%] Building C object wiretap/CMakeFiles/wiretap.dir/file_wrappers.c.o
> /home/alagoutte/wireshark2/wiretap/file_wrappers.c:818:13: error: implicit conversion loses integer precision:
>       '__blksize_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
>                 want = st.st_blksize;
>                      ~ ~~~^~~~~~~~~~

I guess Linux is prepared for the world when files should be read in chunks bigger than 2GB.

I've checked in a change to check whether st.st_blksize <= G_MAXINT and:

	if it is, cast st.st_blksize to int before assigning it;

	if it isn't, just leave "want" at the default value.

Try it now.  

> Have also for all file the following warning...
> warning: unknown warning option '-Wpragmas' [-Wunknown-warning-option]

This change:

	http://anonsvn.wireshark.org/viewvc/trunk/CMakeLists.txt?r1=50760&r2=50759&pathrev=50760

*should* have made CMake use -Werror=unknown-warning-option when testing whether -W options are supported if the compiler supports -Werror=unknown-warning-option, so it *should* leave out all -W options that clang doesn't support.

If that's not happening, that needs to be fixed.