MSVC error C4244

241 views
Skip to first unread message

Nespre t

unread,
Mar 16, 2021, 3:46:27 PM3/16/21
to angleproject
Hi everyone,

I know MSVC is no longer supported but it's still used for the UWP build.

I get this error when I try to compile angle for UWP :

```
PS [20:33:28] ~ C:\dev\libraries\angleproject
> gn --% gen out/uwp_win32_release --args="target_cpu=\"x86\" target_os=\"winuwp\" dcheck_always_on=false is_debug=false is_clang=false treat_warnings_as_errors=false"
Done. Made 61 targets from 64 files in 16460ms
PS [20:33:55] ~ C:\dev\libraries\angleproject
> autoninja -C out/uwp_win32_release -j 1 libGLESv2_static libEGL_static
"C:\dev\depot_tools\ninja.exe" -C out/uwp_win32_release -j 1 libGLESv2_static libEGL_static
ninja: Entering directory `out/uwp_win32_release'
[15/381] CXX obj/angle_common/mathutil.obj
FAILED: obj/angle_common/mathutil.obj
ninja -t msvc -e environment.store_x86 -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x86/cl.exe" /nologo /showIncludes -DUSE_AURA=1 -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINUWP -D__WRL_NO_DEFAULT_LIB__ -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -DWIN10=_WIN32_WINNT_WIN10 -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_VB -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DANGLE_IS_32_BIT_CPU -DANGLE_IS_WIN -I../../include -I../../src -I../../src/common/third_party/base -Igen/angle -I../../include /Gy /FS /bigobj /utf-8 /Zc:sizedDealloc- /wd4117 /D__DATE__= /D__TIME__= /D__TIMESTAMP__= /W4 /wd4091 /wd4127 /wd4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4200 /wd4201 /wd4204 /wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /wd4702 /wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /wd4267 /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Zi /MD /we4244 /we4312 /we4456 /we4458 /we4715 /we4800 /we4838 /wd4447 /TP /wd4577 /GR- /EHsc /c ../../src/common/mathutil.cpp /Foobj/angle_common/mathutil.obj /Fd"obj/angle_common_cc.pdb"
../../src/common/mathutil.cpp(75): error C4244: '=': conversion from 'double' to 'float', possible loss of data
../../src/common/mathutil.cpp(77): error C4244: '=': conversion from 'double' to 'float', possible loss of data
../../src/common/mathutil.cpp(79): error C4244: '=': conversion from 'double' to 'float', possible loss of data
ninja: build stopped: subcommand failed.
```

I can obviously update the BUILD.gn file myself in order to fix the issue but I was wondering if there is a flag to disable the « extra_warnings » config options.


Thanks a lot,


Mark Callow

unread,
Mar 16, 2021, 8:42:42 PM3/16/21
to nespr...@gmail.com, angleproject


On Mar 17, 2021, at 4:46 AM, Nespre t <nespr...@gmail.com> wrote:

../../src/common/mathutil.cpp(75): error C4244: '=': conversion from 'double' to 'float', possible loss of data
../../src/common/mathutil.cpp(77): error C4244: '=': conversion from 'double' to 'float', possible loss of data
../../src/common/mathutil.cpp(79): error C4244: '=': conversion from 'double' to 'float', possible loss of data
ninja: build stopped: subcommand failed.
```

I can obviously update the BUILD.gn file myself in order to fix the issue but I was wondering if there is a flag to disable the « extra_warnings » config options.

These warnings/errors are not MSVC specific though it does seem more likely to spot these issues than clang or gcc. These things should be fixed in the code, most likely with casts, rather than turning off warnings.

Regards

    -Mark

signature.asc

Nespre t

unread,
Mar 17, 2021, 11:32:25 AM3/17/21
to angleproject
You're right, the repository should be updated too I guess.

Geoff Lang

unread,
Mar 17, 2021, 12:29:58 PM3/17/21
to nespr...@gmail.com, angleproject
What version of ANGLE are you using? Those lines don't seem to match up for ToT anymore: src/common/mathutil.cpp

--
You received this message because you are subscribed to the Google Groups "angleproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angleproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angleproject/ddaf9f73-f4ec-4e7a-8e18-3fdec2b5adebn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages