erichkeane wrote:

> I’m not sure it’s defined anywhere whether `nullptr` is a valid argument to 
> `printf`, but if GCC diagnoses this then it should be fine for us to do so as 
> well.

I agree with all you've said in the review.

Quite a few of the functions listed state that it is UB if they get passed 
'nullptr' for the format string, but `printf`/`fprintf` don't do so explicitly 
(I only spot-checked).  However, the entire standard section for `fprintf` 
(`printf` says "does what `fprintf` does, to `stdout`") seems to assume a valid 
format string, so I think this is reasonable.

I'm happy when you are.

https://github.com/llvm/llvm-project/pull/158626
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to