Type qualifiers can refine the standard types and improve the expressivity of type systems.Flow-insensitive type qualifier inference has been used in the CQual framework to improve the quality of C programs.Type casts,however,will affect the effectiveness of type qualifier inference.First a language allowing type casts and its flow-insensitive qualifier inference system were presented. Then this paper proposed a variable-involved inference system,introduced union types and given constraints solving algorithm.Finally,the soundness was proved and some case studies were pre-sented.