X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=diagnostic.c;h=0b92ae578c64389b97684db1aaf3d0f35522f66c;hb=2318f89b43538d07bf531d950e97de33962b574d;hp=65e0de23691853867219921e5ed4bf9446cc5516;hpb=1da7fb4e6a343979ac68d34b469d0a5602c81ffd;p=cparser diff --git a/diagnostic.c b/diagnostic.c index 65e0de2..0b92ae5 100644 --- a/diagnostic.c +++ b/diagnostic.c @@ -1,6 +1,6 @@ /* * This file is part of cparser. - * Copyright (C) 2007-2008 Matthias Braun + * Copyright (C) 2007-2009 Matthias Braun * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -40,7 +40,8 @@ static const source_position_t *curr_pos = NULL; /** * prints an additional source position */ -static void print_source_position(FILE *out, const source_position_t *pos) { +static void print_source_position(FILE *out, const source_position_t *pos) +{ fprintf(out, "at line %u", pos->linenr); if (curr_pos == NULL || curr_pos->input_name != pos->input_name) fprintf(out, " of \"%s\"", pos->input_name); @@ -84,6 +85,14 @@ static void diagnosticvf(const char *const fmt, va_list ap) break; } + case 'S': { + const string_t *str = va_arg(ap, const string_t*); + for (size_t i = 0; i < str->size; ++i) { + fputc(str->begin[i], stderr); + } + break; + } + case 'u': { const unsigned int val = va_arg(ap, unsigned int); fprintf(stderr, "%u", val);