+
+ if (warning.unused_label) {
+ for (const label_statement_t *label_statement = label_first;
+ label_statement != NULL;
+ label_statement = label_statement->next) {
+ const declaration_t *label = label_statement->label;
+
+ if (! label->used) {
+ if (first_err) {
+ first_err = false;
+ diagnosticf("%s: In function '%Y':\n",
+ current_function->source_position.input_name,
+ current_function->symbol);
+ }
+ warningf(label_statement->statement.source_position,
+ "label '%Y' defined but not used", label->symbol);
+ }
+ }
+ }
+ label_first = label_last = NULL;