lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.08k stars 425 forks source link

HuffmanTree_cleanup: change initializer of mask to a real constant constant #104

Closed sezero closed 5 years ago

sezero commented 5 years ago

fixes build by Watcom.

lvandeve commented 5 years ago

Hi, what's the error message that Watcom gives for this? Thanks

sezero commented 5 years ago

Hi, what's the error message that Watcom gives for this? Thanks

lodepng.c(613): Error! E1054: Expression must be constant

lvandeve commented 5 years ago

Hmm, I wonder why gcc and clang aren't giving this error. Accepting in case it breaks on more compilers, thanks for finding this!

sezero commented 5 years ago

Hmm, I wonder why gcc and clang aren't giving this error.

Watcom is too strict for it. IIRC, it used to have a special switch that makes it accecpt non-constant initializers?, but never used it my self and don't know how experimental/reliable it is.