This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Missing warning opportunity - code after break;


Just noticed this:
while(something)
{
	// stuff

	if (num_elements == 0)
	{
		break;
		--current_group;
	}
}

doesn't trigger a warning in GCC 5.1, 6.3 and 7.1. The line after "break;" is unused, probably should be before the break, ie. user error.

Matt Bentley


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]