First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

getting error wsbuild64/wiretap/ascend.c(1155,1): error C2220 when trying to build wireshark sources

Hello, I get the following error when building the wireshark sources:

wsbuild64/wiretap/ascend.c(1155,1): error C2220: the following warning is treated as an error [<>\wsbuild64\wiretap\wiretap.vcxproj]

Can you please help? All packages where installed according to 2.2. Win32/64: Step-by-Step Guide I use Win10 64 bit

Thanks, Bella

Bella's avatar
3
Bella
asked 2020-10-16 07:57:38 +0000
grahamb's avatar
23.8k
grahamb
updated 2020-10-16 10:55:03 +0000
edit flag offensive 0 remove flag close merge delete

Comments

It's likely that we would need to see the complete output of both the CMake generation step and the msbuild step. Redirect the outputs to a file by appending 2>&1 > somefile.txt to the commands and then putting the text files on a public share and posting a link back to them here.

grahamb's avatar grahamb (2020-10-16 10:56:47 +0000) edit

Hi, The files can be found here and here

Thank you, Bella

Bella's avatar Bella (2020-10-16 15:48:52 +0000) edit

The actual error is:

112>D:/Bella/Wireshark/dev/wsbuild64/wiretap/ascend.c(1155,1): warning C4244: 'initializing': conversion from '__int64' to 'long', possible loss of data

As to why you're getting that, it's something in your env. The generation of ascend.c also looks a bit odd:

112>CustomBuild:
     D:/Bella/Wireshark/dev/wireshark/wiretap/ascend.y:8.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
         8 | %pure-parser
           | ^~~~~~~~~~~~
           | %define api.pure

...

112>D:/Bella/Wireshark/dev/wireshark/wiretap/ascend.y : warning : fix-its can be applied.  Rerun with option '--update'. [-Wother]

I'm building my self at the moment to check that.

grahamb's avatar grahamb (2020-10-16 16:20:38 +0000) edit

Build and compile is clean for me. What do you have in the CMakeCache.txt file in the build directory for YACC_EXECUTABLE:FILEPATH? That should point to win_bison.exe.

grahamb's avatar grahamb (2020-10-16 17:13:40 +0000) edit

It is YACC_EXECUTABLE:FILEPATH=C:/ProgramData/chocolatey/bin/win_bison.exe The path is correct

Bella's avatar Bella (2020-10-16 18:28:26 +0000) edit
add a comment see more comments

2 Answers

0

This is a combination of MSVC avoiding, I guess, not conforming to C89 or C99 by not claiming to conform to them, and Bison assuming the C compiler will claim C99 conformance if it defines ptrdiff_, causing the compiler to arrange that the generated parser use long instead of ptrdiff_t for the difference between two pointers - that's not valid in 64-bit Windows.

We've developed and committed a workaround; see issue 16924. Gerald Combs also has a workaround for the separate problem of the warning about %pure-parser (it involves generating different .y files depending on whether the parser generator supports %define api.pure); see merge request 632, which should remove that warning without breaking builds with older versions of Bison or with Berkeley YACC, but won't fix the compiler warning that's turning into an error.

Guy Harris's avatar
19.9k
Guy Harris
answered 2020-10-19 11:00:29 +0000, updated 2020-10-19 19:53:42 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

I uninstalled the latest winflexbison3 package and downgraded to the previous version choco install winflexbison3 --version=2.5.18.20190508 it solved my issue

Bella's avatar
3
Bella
answered 2020-10-17 07:47:31 +0000
edit flag offensive 0 remove flag delete link

Comments

This has been reported before, that bison 3.x causes issues. Personally I use chocolatey to install the plain "winflexbison" package that seems to be stuck on 2.4.9.20170215.

The release notes for bison 3.0 state there are incompatibility issues, I've raised issue 16924 for that.

grahamb's avatar grahamb (2020-10-17 11:26:19 +0000) edit

But the section 2.2.9 of the Developer's guide says we need to install winflexbison3: choco install -y winflexbison3 I think it should be fixed

Bella's avatar Bella (2020-10-17 20:47:54 +0000) edit

Thank you for your help! Please notice that winbison 3.3 works well for me, but the latest winbison 3.7.1 caused the build failure. Thanks, Bella

Bella's avatar Bella (2020-10-17 20:53:47 +0000) edit

Please add any comments you have on the issue I noted above.

grahamb's avatar grahamb (2020-10-18 16:53:53 +0000) edit

done Thank you

Bella's avatar Bella (2020-10-18 19:51:33 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer