-
Notifications
You must be signed in to change notification settings - Fork 19
Description
@mattmccutchen-cci suggested the following in #1159:
A side issue: as I briefly suggested in my original post, IMO the Checked-C-specific format string checks (currently in CheckVarargsInCheckedScope) should generate at least -Wformat warnings (or maybe even errors) in unchecked scopes too, if checked pointers or arrays are being used. (No new diagnostics would be generated in plain-C code that does not use checked pointers or arrays.) This would be consistent with the passing of arguments to non-variadic functions and would help catch problems sooner. In essence, we want to check a printf argument corresponding to a %s as if the declared parameter type were const char * : itype(_Nt_array_ptr), and so forth. I realize this is outside the scope of the original title of this issue. Do you prefer that I broaden the title or file a separate issue?