On Tue, Mar 25, 2025 at 11:06:05AM -0400, Jason Merrill wrote: > > The patch introduces 2 new warnings. > > -Wmusttail-local-addr > > which is turn on by default and warns for the always dumb cases of passing > > an address of a local variable or parameter to musttail call's argument. > > I don't think this is a significantly different case from > -Wreturn-local-addr; in both cases we are passing a local address out at the > same time as the stack frame goes away, the only difference is whether it's > passed by return or argument. I don't think that difference justifies using > a different flag. > > If others agree with you I don't mind going along, just wanted to make my > case.
Both those warnings are enabled by default, so the exact naming of the warning flags matters only to users who would like to silence it for some strange reason (and they will get the option in the warning printed, so it is a cut and paste in that case for them). Having two different ones allows it to be disabled separately. And while both are related, the -Wreturn-local-addr name doesn't match what this new warning warns about, so it would need to be explained in the documentation that it isn't just about returning local addresses but also about passing local addresses to musttail which is related. Anyway, I can live with it if others agree on -Wreturn-local-addr plus -Wmaybe-musttail-local-addr (or some other name). Jakub