Wireshark-dev: Re: [Wireshark-dev] MSVC 2015 (VC14) notes/issue
From: Graham Bloice <[email protected]>
Date: Wed, 12 Aug 2015 17:38:24 +0100
On 12 August 2015 at 17:21, Bill Meier <[email protected]> wrote:
[Resend]

I see that several people (Anders, ...) been building with MSVC-2015 (VC14) and have fixed a number of issues.

So: I decided to download VC14 and give it a try (using NMake).

A few questions:

Are you using CMake or NMake ?


I think the general plan was to move to CMake, although there are some hold-outs.  README.cmake has the details, although there would be some adjustments required to generate a solution for VS2015 (I think the CMake generator option is "Visual Studio 14").

I've been meaning to update the Dev Guide to have CMake as the primary build for Windows for some time, but spare time to do it has been limited.
 
If using NMake, I assume that you've updated config.nmake & etc. Is there some reason you've not committed the changes ?

If not, I've made what I think are the required changes for NMake. Do you think it's Ok to commit them ?


See change 8683, I presume that's still live Anders?
 


Have you been able to do a complete build ?

So far:

1. Compiling packet-pdc.c gets:

[...]\packet-pdc.c(205) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
 Help menu, or open the Technical Support help file for more information

INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information

I've figured out what to change to fix this.
(I've also extracted a much smaller test file which causes the error and will submit the file to Microsoft).



2. I had to disable building with geoip because:

C:\Program Files\Windows Kits\10\include\10.0.10150.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition (compiling source file packet-
ip.c)
[...]\GeoIP-1.5.1-2-win32ws\include\GeoIP.h(36): note: see previous definition of 'snprintf' (compili
ng source file packet-ip.c)
C:\Program Files\Windows Kits\10\include\10.0.10150.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Stan
dard Library function declaration (compiling source file packet-ip.c)


3. I disabled building with LUA because there's apparently yet no LUA library (dll) for use with VC14.

 
CMake should handle that, I'd like to know if it doesn't.
 

After addressing #1, #2 & #3 above (as well as an issue in packet-lwres.c), I got a complete working build (based upon a quick test).


4. When compiling with code-analysis enabled, I'm getting a boatload of the following warning message:

c:\program files\windows kits\10\include\10.0.10150.0
\ucrt\string.h(130) : warning C28252: Inconsistent annotation for
'strcpy': _Param_(1) has 'SAL_w
ritableTo(elementCount(_String_length_(__formal(1,parameter1))+1))' on
the prior instance. See <no file>(0).


This makes using "analysis" with vc14 kind of difficult.

I've also noticed that elsewhere.  Looks like a MS issue with bad SAL annotations in the SDK headers.


--
Graham Bloice