Long story short... I was trying to build all sources in in order to achieve less "false positive" effect on VirusTotal, but that's not the point!
I have tried VS 6 , Windows 7 DDK, 2010 and 2019 tools ( actually 2015 , 2017 built in 2019 ) and was not being able to build from scratch without any warnings/errors/app crashes in VS 6 and all 2019 built-in stuff.
All of later is only for x86 platform
Input: BuildVS6.cmd
chcp 850
SET "LIB=%ProgramFiles(x86)%\Microsoft Visual Studio\VC98\Lib"
SET "PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\VC98\Bin;%PATH%"
SET "INCLUDE=%ProgramFiles(x86)%\Microsoft Visual Studio\VC98\Include;%Include%"
CHDIR /D "C:\Sources\yori"
nmake
VS 6 output to mention:
*** Compiling pkglib
api.c
backup.c
create.c
install.c
reg.c
remote.c
util.c
Generating Code...
remote.c(1565) : warning C4701: local variable 'NewerVersionAvailable' may be used without having been initialized
remote.c(1565) : error C2220: warning treated as error - no object file generated
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
I understand that this is just a warning, but maybe it will help to solve something, since this warning is in yoripkg
and may be this leads into false positive... sorry if this is completely silly but I am not a senior developer, not even an intermediate, just know that sometimes very little things leads to very huge problems)
And this is not the point for me since I do not need to work with VS 6 at all... But the second one is really what bothers me
VS2019 story.
Input: build.cmd
chcp 850
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 -vcvars_ver=14.16
CHDIR /D "C:\Sources\yori"
nmake
Since I was able to build all source without any warnings/errors in VS 2019 Community with 2017 tools installed, since the goal was to build all stuff, that can work on XP, and 2017 compiling tools is able to do so, or maybe I am totally do not understand something) So I build source and it runs well untill I have entered dir
command and dir.exe
crashed on clean XP SP3 without any updates, and I decide to dig a little in) By the way oneyori.exe
crashed in the same way on entering dir
command ( and later tests I have done mostly with oneyori.exe
)
Therefore I've built the Debug version of source and... nothing crashed at all ))) That was funny)) Finally I have figured out that makefile
compiler option -O1sb1
is to be blamed) After that I have tried -O2
and builded exe crashed, after that I build with -Ox
option and dir
do not crashed but there was a strange behavior in output, I do not even know how to describe it... just take a look:
-Ox
seems not to works properly and... I have noticed the same behaviour when trying to build with 2015 VS tools, without any -O
swith modification, so by default with -O1sb1
VS2015 tools provides binaries with the same output problems as VS2017 with -Ox
I have firured out that only -Od
switch on VS2017 tools provides stable binary at least for dir
, I assume there maybe more not working stuff, but now the only thing I saw is dir
.
And the correct output is^
So finally I have built DEBUG version with VS2017 Tools with -O1sb1
, started oneyori.exe
, attached debugger to it, entered dir
command and here is what I've got:
Sorry for such a long message... just trying to decribe as completely as possible)
P.S. I think you will find that funny)
All that chcp 850
stuff in my batch script is only to switch codepage to 850 since cl.exe
is locale-dependend and your makefile doesn't work by default on any non-english system with region-dependent locale)) That was confusing but nobody have been surprised) facepalm