# Strict aliasing in C code translated from ATS

**URL:** https://discourse.ats-lang.org/t/strict-aliasing-in-c-code-translated-from-ats/731
**Category:** Google Group
**Created:** [March 16, 2016, 3:34am UTC](https://discourse.ats-lang.org/t/strict-aliasing-in-c-code-translated-from-ats/731 "2016-03-16T03:34:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Artyom\_Shalkhakov](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@Artyom\_Shalkhakov](https://discourse.ats-lang.org/u/Artyom_Shalkhakov)
#### Post date: [March 16, 2016, 3:34am UTC](https://discourse.ats-lang.org/t/strict-aliasing-in-c-code-translated-from-ats/731/1 "2016-03-16T03:34:23Z")

</div>

I’ve read this piece:

[http://blog.regehr.org/archives/1307](http://blog.regehr.org/archives/1307)

And now I’m wondering if C code generated from ATS sources may contain UBs  
due to strict aliasing?

---

<div class="post-metadata">

### Author: ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)
#### Post date: [March 16, 2016, 5:26pm UTC](https://discourse.ats-lang.org/t/strict-aliasing-in-c-code-translated-from-ats/731/2 "2016-03-16T17:26:44Z")

</div>

Actually, I am not so sure about this. Maybe in ATS1?

In ATS2. you essentially can only have void\* pointers; casting  
happens at the point where dereference is done. So something  
like

void foo (int \*x, long \*y)

should not be generated. If it gets generated, I would definitely  
look into the issue.On Tuesday, March 15, 2016 at 11:34:23 PM UTC-4, Artyom Shalkhakov wrote:

> I’ve read this piece:
> 
> [The Strict Aliasing Situation is Pretty Bad – Embedded in Academia](http://blog.regehr.org/archives/1307)
> 
> And now I’m wondering if C code generated from ATS sources may contain UBs  
> due to strict aliasing?
