This might be something too obvious. However, I couldn\'t find the specific answer though many stackoverflow threads talk about different aspects of this.
typede
The sizeof operator have two forms:
sizeof expression sizeof(type)
As you're giving it a type, you need the parenthesis, sizeof(tmp)
sizeof(tmp)