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] wslua: checkNSTime / pushNSTime undefined

From: chuck c <bubbasnmp@xxxxxxxxx>
Date: Thu, 27 May 2021 20:03:07 -0500
My bad. Upgraded Visual Studio and it now ships with cmake 3.20.
choco installing cmake 3.19 fixed the errors.

Original working system:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29912 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>cmake --version
cmake version 3.19.20122902-MSVC_2

--------------------

New system (bad cmake):
W:\Development\wsbuild>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30037 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

W:\Development\wsbuild>cmake --version
cmake version 3.20.21032501-MSVC_2

Fixed with:
choco install -y cmake --version 3.19.8
update PATH to reach this cmake first

W:\Development\wsbuild64>where cmake
C:\Program Files\CMake\bin\cmake.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe

W:\Development\wsbuild64>
W:\Development\wsbuild64>cmake --version
cmake version 3.19.8

CMake suite maintained and supported by Kitware (kitware.com/cmake).

W:\Development\wsbuild64>


On Thu, May 27, 2021 at 6:57 PM chuck c <bubbasnmp@xxxxxxxxx> wrote:
Is it a matter of tweaking the build to allow the warning to pass or does this require a code change?

W:\Development\wsbuild>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30037 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Build FAILED.

       "W:\Development\wsbuild\Wireshark.sln" (default target) (1) ->
       "W:\Development\wsbuild\epan\wslua\wslua.vcxproj.metaproj" (default target) (73) ->
       "W:\Development\wsbuild\epan\wslua\wslua.vcxproj" (default target) (79) ->
       (ClCompile target) ->
         W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): warning C4013: 'pushNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): warning C4013:         pushNSTime(L, nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): warning C4013:                   ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): warning C4013: 'pushNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): warning C4013:                 pushNSTime(L,nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): warning C4013:                           ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): warning C4013: 'pushNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): warning C4013:                     pushNSTime(L,nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): warning C4013:                               ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4013: 'checkNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4013:                     item = proto_tree_add_time(tree_item->tree,hfid,tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,checkNSTime(L,1)); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4013:                                                                                                                         ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_tree.c(383,126): warning C4047: 'function': 'const nstime_t *' differs in levels of indirection from 'int' [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,126): warning C4047:                     item = proto_tree_add_time(tree_item->tree,hfid,tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,checkNSTime(L,1)); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,126): warning C4047:                                                                                                                              ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4024: 'proto_tree_add_time': different types for formal and actual parameter 6 [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4024:                     item = proto_tree_add_time(tree_item->tree,hfid,tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len,checkNSTime(L,1)); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(383,121): warning C4024:                                                                                                                         ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): warning C4013: 'checkNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): warning C4013:     NSTime nstime = checkNSTime(L,2); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): warning C4013:                                ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,1): warning C4047: 'initializing': 'NSTime' differs in levels of indirection from 'int' [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,1): warning C4047:     NSTime nstime = checkNSTime(L,2); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,1): warning C4047: ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_frame_info.c(131,15): warning C4013: 'pushNSTime' undefined; assuming extern returning int [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(131,15): warning C4013:     pushNSTime(L,nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(131,15): warning C4013:               ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]


       "W:\Development\wsbuild\Wireshark.sln" (default target) (1) ->
       "W:\Development\wsbuild\epan\wslua\wslua.vcxproj.metaproj" (default target) (73) ->
       "W:\Development\wsbuild\epan\wslua\wslua.vcxproj" (default target) (79) ->
       (ClCompile target) ->
         W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): error C2220: the following warning is treated as an error [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): error C2220:         pushNSTime(L, nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tvb.c(897,19): error C2220:                   ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): error C2220: the following warning is treated as an error [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): error C2220:                 pushNSTime(L,nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_field.c(148,27): error C2220:                           ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): error C2220: the following warning is treated as an error [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): error C2220:                     pushNSTime(L,nstime); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_tree.c(111,31): error C2220:                               ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
         W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): error C2220: the following warning is treated as an error [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): error C2220:     NSTime nstime = checkNSTime(L,2); [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]
       W:\Development\wireshark\epan\wslua\wslua_frame_info.c(112,32): error C2220:                                ^ [W:\Development\wsbuild\epan\wslua\wslua.vcxproj]

    9 Warning(s)
    4 Error(s)