# Code compatible to 1.0 and 0.6 - SOLVED -

**URL:** <https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150>\
**Category:** General Usage\
**Created:** [January 27, 2019, 3:18pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150 "2019-01-27T15:18:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 27, 2019, 3:18pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150/1 "2019-01-27T15:18:53Z")

</div>

The following code fails:

```julia
if VERSION >= v"0.7.0"
	ccall(:jl_exit_on_sigint, Nothing, (Cint,), 0)
else
	ccall(:jl_exit_on_sigint, Void, (Cint,), 0)
end

```

with the warning on 0.7:

```julia
WARNING: Base.Void is deprecated, use Nothing instead.

```

It fails with an error on 1.0. But why? I am checking for the version.

Any idea?

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [January 27, 2019, 3:38pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150/2 "2019-01-27T15:38:10Z")

</div>

`ccall` may be does checking in parsing time or if it is in top node, julia tries to compile both and run conditionally.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 27, 2019, 3:39pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150/3 "2019-01-27T15:39:47Z")

</div>

Any workaround?

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [January 27, 2019, 3:40pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150/4 "2019-01-27T15:40:17Z")

</div>

`@static if`?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 27, 2019, 3:45pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150/5 "2019-01-27T15:45:17Z")

</div>

Thanks, that works. 😄
