# How to turn off warning in JuMP

**URL:** <https://discourse.julialang.org/t/how-to-turn-off-warning-in-jump/1400>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [January 10, 2017, 6:07pm UTC](https://discourse.julialang.org/t/how-to-turn-off-warning-in-jump/1400 "2017-01-10T18:07:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FANG\_Colin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fang_colin/32/170_2.png) [@FANG\_Colin](https://discourse.julialang.org/u/FANG_Colin)\
**Post date:** [January 10, 2017, 6:07pm UTC](https://discourse.julialang.org/t/how-to-turn-off-warning-in-jump/1400/1 "2017-01-10T18:07:47Z")

</div>

I made a helper function for constraints

```julia
"""
If x is Bin & y is Int, it simply means x = y % 2.
"""
function addParityConstraint(model::JuMP.Model, x, y)
    @variable(model, odd_dummy, Int)
    @constraint(model, x + y == 2 * odd_dummy)
end

```

But keeps getting

```julia
WARNING: A variable named odd_dummy is already attached to this model. 
If creating variables programmatically, consider using the anonymous variable syntax x = @variable(m, [1:N], ...).

```

How to avoid the warnings? I cannot get anonymous variable with types working, e.g. `@variable(model, Int)`

---

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [January 10, 2017, 6:38pm UTC](https://discourse.julialang.org/t/how-to-turn-off-warning-in-jump/1400/2 "2017-01-10T18:38:47Z")

</div>

You cannot disable the warnings. After issue [#741](https://github.com/JuliaOpt/JuMP.jl/issues/741) is fixed you’ll be able to set the variable category inside the macro, but for now you can use

```julia
odd_dummy = @variable(model)
setcategory(odd_dummy,:Int)

```
