On Thu, 22 Sep 2016, Prathamesh Kulkarni wrote: > Would that be acceptable ? I am not sure how to make %Z check if the > argument has type vec<int> * > since vec<int> is not really a builtin C type. > Could you suggest me a better solution so that the format checker will check > if arg has type vec<int> * instead of checking if it's just a pointer ? > Also for testing, should I create a testcase in g++.dg since > gcc.dg/format/ tests are C-only ?
If it's C++-only then it would need to be in g++.dg. The way we handle GCC-specific types in checking these formats is that the code using these formats has to define typedefs which the format-checking code then looks up. In most cases it can just look up names like location_t or tree, but for HOST_WIDE_INT it looks up __gcc_host_wide_int__ which the user must have defined as a typedef. Probably that's the way to go in this case: the user must do "typedef vec<int> __gcc_vec_int__;" or similar, and the code looks up __gcc_vec_int__. -- Joseph S. Myers jos...@codesourcery.com