Fix numerous warnings in Windows build #103

Open
mmp opened this Issue Dec 22, 2016 · 2 comments

Projects

None yet

2 participants

@mmp
Owner
mmp commented Dec 22, 2016

See e.g. the log from https://ci.appveyor.com/project/mmp/pbrt-v3/branch/master/job/o6mnyvvdcaacwv5c

  • There are a lot of size_t -> int conversion warnings
  • std::streamsize -> int conversion warnings out of MSVC's type_traits header, for reasons unknown
  • most annoyingly, a ton of "libpbrt.lib(lightdistrib.obj) : warning LNK4049: locally defined symbol ??$MakeCheckOpValueString@D@google@@YAXPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEBD@Z (void __cdecl google::MakeCheckOpValueString(class std::basic_ostream<char,struct s" out of the google logging stuff. Where "ton" is ~5700 lines of spew.
@syoyo
Contributor
syoyo commented Jan 6, 2017

There are a lot of size_t -> int conversion warnings

FYI this kind of warning can be checked using clang with -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic compiler flags, and some of warnings may be automatically fixed using clang-tidy with -fix option: http://clang.llvm.org/extra/clang-tidy/

@syoyo
Contributor
syoyo commented Jan 6, 2017

most annoyingly, a ton of "libpbrt.lib(lightdistrib.obj) : warning LNK4049: locally defined symbol

This issue may be related to this: http://stackoverflow.com/questions/6979491/how-to-delete-warnings-lnk4217-and-lnk4049

FYI, compiling all code with /MT(Multi-threaded) does not show LNK4049/4217 warnings.
For some reason, default runtime library is set to '/MD(Multi-threaded DLL) through cmake's default configure(cmake -G "Visual Studio 14 2015 Win64" ..). Although, if you want to support building libpbrt as a DLL, this isn't a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment