Skip to content

Type conversion warnings on Windows+MSVC #65

Description

@eyalroz

We're getting lots and lots of warnings building dbgen with MSVC:

\src\bcd2.c(84): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(107): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(129): warning C4244: '=': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(130): warning C4244: '+=': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(134): warning C4244: '+=': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(144): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
\src\bcd2.c(165): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [\dbgen.vcxproj]
  bm_utils.c
\src\bm_utils.c(111): warning C4273: 'getenv': inconsistent dll linkage [\dbgen.vcxproj]
  c:\program files (x86)\windows kits\10\include\10.0.17134.0\ucrt\stdlib.h(1191): note: see previous definition of 'getenv'
  build.c
\src\build.c(252): warning C4244: 'function': conversion from 'double' to 'long', possible loss of data [\dbgen.vcxproj]
  driver.c
\src\driver.c(842): warning C4244: '*=': conversion from 'double' to 'long', possible loss of data [\dbgen.vcxproj]
\src\driver.c(1157): warning C4244: '=': conversion from 'double' to 'long', possible loss of data [\dbgen.vcxproj]
  load_stub.c
  permute.c
  print.c
\src\print.c(764): warning C4244: '+=': conversion from '__int64' to 'unsigned long', possible loss of data [\dbgen.vcxproj]
  rnd.c
  speed_seed.c
\src\speed_seed.c(123): warning C4244: '=': conversion from '__int64' to 'RND', possible loss of data [\dbgen.vcxproj]
\src\speed_seed.c(135): warning C4244: 'function': conversion from '__int64' to 'RND', possible loss of data [\dbgen.vcxproj]
  text.c
  Generating Code...

and about the same errors when building qgen.

In this issue, we'll consider just the type conersion, not the DLL linkage warning. These might be due to the fact that we kept an int type for BCD arithmetic function return types. Let's change those and see what happens.

@valco1994 : FYI.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions