glcpp: Print locations in error messages where possible.
diff --git a/glcpp/glcpp-parse.y b/glcpp/glcpp-parse.y
index d7a1048..0444b0c 100644
--- a/glcpp/glcpp-parse.y
+++ b/glcpp/glcpp-parse.y
@@ -733,7 +733,7 @@
 	case IDENTIFIER:
 	case INTEGER_STRING:
 	case OTHER:
-		glcpp_printf (*out, "%s", token->value.str);
+		glcpp_print (*out, token->value.str);
 		break;
 	case SPACE:
 		glcpp_print (*out, " ");
@@ -855,7 +855,8 @@
 		return combined;
 	}
 
-	glcpp_print (parser->errors, "Error: Pasting \"");
+	glcpp_error (&token->location, parser, "");
+	glcpp_print (parser->errors, "Pasting \"");
 	_token_print (&parser->errors, token);
 	glcpp_print (parser->errors, "\" and \"");
 	_token_print (&parser->errors, other);
@@ -946,7 +947,7 @@
 		while (next && next->token->type == SPACE)
 			next = next->next;
 		if (next == NULL || next->token->type != IDENTIFIER) {
-			glcpp_print (parser->errors, "Error: operator \"defined\" requires an identifier\n");
+			yyerror (&node->token->location, parser, "operator \"defined\" requires an identifier\n");
 			exit (1);
 		}
 		macro = hash_table_find (parser->defines,
@@ -1093,8 +1094,7 @@
 	case FUNCTION_NOT_A_FUNCTION:
 		return NULL;
 	case FUNCTION_UNBALANCED_PARENTHESES:
-		glcpp_printf (parser->errors, "Error: Macro %s call has unbalanced parentheses\n",
-			      identifier);
+		glcpp_error (&node->token->location, parser, "Macro %s call has unbalanced parentheses\n", identifier);
 		exit (1);
 		return NULL;
 	}
@@ -1110,7 +1110,7 @@
 		_argument_list_length (arguments) == 1 &&
 		arguments->head->argument->head == NULL)))
 	{
-		glcpp_printf (parser->errors,
+		glcpp_error (&node->token->location, parser,
 			      "Error: macro %s invoked with %d arguments (expected %d)\n",
 			      identifier,
 			      _argument_list_length (arguments),
@@ -1180,7 +1180,7 @@
 			next_non_space = next_non_space->next;
 
 		if (next_non_space == NULL) {
-			glcpp_print (parser->errors, "Error: '##' cannot appear at either end of a macro expansion\n");
+			yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
 			return NULL;
 		}