You're casting m from an integer to an address, not returning its address.
You can return the address of a local variable, but it will result in undefined behavior. Anything could happen - your computer could explode, your compiler is allowed to reject it, it could install a virus and start up Portal 2, or it might just appear to work and let you overwrite random memory. I'm not kidding.