Fix src/libraries to build on clang 10 (#33734)
authorOmair Majid <omajid@redhat.com>
Fri, 20 Mar 2020 00:23:36 +0000 (20:23 -0400)
committerGitHub <noreply@github.com>
Fri, 20 Mar 2020 00:23:36 +0000 (17:23 -0700)
commit2cf9265c979fbcf16b000a4f54b81c48bb57b439
tree819dab5e085a692e6885ff0d245e7517f977c599
parent96d90cdffc5187c965f3363b25131fd2a889bd07
Fix src/libraries to build on clang 10 (#33734)

Clang 10 enable new warnings, some of which is affecting the
src/libraries code.

Clang 10 has added `-Walloca` to warn about uses of `alloca`. This
commit replaces the only non-compliant use of that with a single fixed
stack-allocated buffer.

Clang 10 has also added `-Wimplicit-int-float-conversion`. This commit
uses explicit casts to double to avoid the warnings.

Fixes #33681

Also contains a small fix for slist.h that was somehow missed in #33096.

After this commit, I can build all of runtime with Clang 10.
src/coreclr/src/inc/slist.h
src/libraries/Native/Unix/System.Native/pal_io.c
src/libraries/Native/Unix/System.Native/pal_time.c