The method is safe as far as I can see. The (int) converts the definition to a temporary variable, which can then be used in expressions.

We intend to make the sizeof() anyway a real function in one of the next updates, because otherwise it's a potential source of bugs.