Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Checked C format-string checks to unchecked scopes #1225

Open
dtarditi opened this issue Dec 3, 2023 · 0 comments
Open

Extend Checked C format-string checks to unchecked scopes #1225

dtarditi opened this issue Dec 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dtarditi
Copy link
Member

dtarditi commented Dec 3, 2023

@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?

@dtarditi dtarditi added the enhancement New feature or request label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant