evansm7 / riscix_ide

IDE driver for Acorn's RISC iX 4.3BSD
3 stars 1 forks source link

IMPDEF/UB #1

Closed Number0000009 closed 2 years ago

Number0000009 commented 2 years ago

https://github.com/evansm7/riscix_ide/blob/fc6389873cb48ad7c1738277156a1437062b3b24/ecide_parts.c#L230

Shifting right a 32-bit Integer is either UB or IMPDEF depending on a version of the C standard (i.e. C11 §6.5.7/p4 N1570).

evansm7 commented 2 years ago

Right you are. (AFAIR the Norcroft C compiler doesn't accept numerical suffixes like 1UL. In this instance I believe it, due to lack of cleverness, generates correct code but ew anyway.) I'll fix it in the fancy upcoming next release, cheers.