C++ PATCH to warn about inlines which fail to return a value

Jason Merrill jason@redhat.com
Tue Feb 5 08:30:00 GMT 2002


>>>>> "Fergus" == Fergus Henderson <fjh@cs.mu.oz.au> writes:

> Won't this patch result in spurious warnings in cases such as
> 	int foo() {
> 		// deliberate infinite loop
> 		// (perhaps exited via exception or longjmp)
> 		for (;;) {
> 			bar();
> 		}
> 	}

> ?

I suppose so, but how common is code like that, really?  Besides, adding a
return statement is a simple, harmless workaround.

Jason



More information about the Gcc-patches mailing list