sac2c issueshttps://gitlab.sac-home.org/sac-group/sac2c/-/issues2022-03-29T15:57:45Zhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/2313semantics of abs() does not check against overflows2022-03-29T15:57:45ZRobert Berneckysemantics of abs() does not check against overflowsI have been chasing problems with array formatting in apex. I narrowed it down to this just now:
```
sac2c_d -V
sac2c 1.3.3-MijasCosta-799-gb7a97
build-type: DEBUG
built-by: "sac" at 2022-03-23T09:54:38
```
```
// after -bopt:cyc:tup...I have been chasing problems with array formatting in apex. I narrowed it down to this just now:
```
sac2c_d -V
sac2c 1.3.3-MijasCosta-799-gb7a97
build-type: DEBUG
built-by: "sac" at 2022-03-23T09:54:38
```
```
// after -bopt:cyc:tup:1, the result of abs(v) is AKV. This is awesome.
// after -bopt:cyc:tup:1, the value of abs(v) is negative. This is awful.
use Array:all;
int main()
{
v = -2147483648;
StdIO::print(v);
StdIO::print( abs(v));
return(0);
}
```
NB. The value of v is critical here.