Ask Your Question
0

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

asked 2020-10-16 07:57:38 +0000

Bella gravatar image

updated 2020-10-16 10:55:03 +0000

grahamb gravatar image

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

edit retag flag offensive 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 gravatar imagegrahamb ( 2020-10-16 10:56:47 +0000 )edit

Hi, The files can be found here and here

Thank you, Bella

Bella gravatar imageBella ( 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 gravatar imagegrahamb ( 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 gravatar imagegrahamb ( 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 gravatar imageBella ( 2020-10-16 18:28:26 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-10-19 11:00:29 +0000

Guy Harris gravatar image

updated 2020-10-19 19:53:42 +0000

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.

edit flag offensive delete link more
0

answered 2020-10-17 07:47:31 +0000

Bella gravatar image

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

edit flag offensive delete link more

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 gravatar imagegrahamb ( 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 gravatar imageBella ( 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 gravatar imageBella ( 2020-10-17 20:53:47 +0000 )edit

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

grahamb gravatar imagegrahamb ( 2020-10-18 16:53:53 +0000 )edit

done Thank you

Bella gravatar imageBella ( 2020-10-18 19:51:33 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-10-16 07:57:38 +0000

Seen: 894 times

Last updated: Oct 19 '20