On 25/03/2022 18:56, Jason Merrill via Gcc-patches wrote:
Perhaps a suitable compromise would be to add a separate warning flag specifically for the strn* warnings, so users deliberately using the bound to express a limit other than the length of the argument string (and confident that their strings are always NUL-terminated) can turn them off without turning off all the overread warnings.

For strncmp (in cases where NUL termination cannot be proven) that is perhaps a reasonable compromise. However I think I need to take a closer look to figure out if there are other ways to work around this, especially since discovering that I had misread the previous report.

I take back this patch and will revisit this a bit later, probably once stage 1 opens.

Thanks,
Siddhesh

Reply via email to