gpac / ComplianceWarden

A pluggable compliance checker (ISOBMFF, HEIF/MIAF/AVIF, AV1 HDR10+)
https://gpac.github.io/ComplianceWarden-wasm/
Other
16 stars 7 forks source link

Cast sym.value to uint32_t when inserting to itemRefs #39

Closed vigneshvg closed 1 year ago

vigneshvg commented 1 year ago

Without the cast, it results in the following compilation error: error: narrowing conversion of ‘(int64_t)sym.Symbol::value’ from ‘int64_t’ {aka ‘long int’} to ‘unsigned int’ [-Werror=narrowing]

This cast is similar to other ones in the file.

rbouqueau commented 1 year ago

Thank you. Are you building to a 32 bits target?

vigneshvg commented 1 year ago

Thank you. Are you building to a 32 bits target?

No. But i don't think the target matters.

The key type of itemRefs is uint32_t and sym.value is of type int64_t. So, it would cause a narrowing conversion error irrespective of the target.

rbouqueau commented 1 year ago

clang14 and gcc12 on Linux don't raise this legit warning. I'm trying to find a way to better catch them in the future.

vigneshvg commented 1 year ago

clang14 and gcc12 on Linux don't raise this legit warning. I'm trying to find a way to better catch them in the future.

that's weird, because this warning gets triggered on my linux machine with clang 14.0.6-2.

rbouqueau commented 1 year ago

Weird:

$ clang -v
Debian clang version 14.0.6-2

Thanks anyway!