aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 27ae036..dcbadce 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -37,6 +37,7 @@ along with Gcov; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "intl.h"
+#include "diagnostic.h"
#include "version.h"
#include <getopt.h>
@@ -342,7 +343,6 @@ static int flag_preserve_paths = 0;
static int flag_counts = 0;
/* Forward declarations. */
-static void fnotice (FILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
static int process_args (int, char **);
static void print_usage (int) ATTRIBUTE_NORETURN;
static void print_version (void) ATTRIBUTE_NORETURN;
@@ -369,12 +369,22 @@ main (int argc, char **argv)
{
int argno;
int first_arg;
+ const char *p;
+
+ p = argv[0] + strlen (argv[0]);
+ while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+ --p;
+ progname = p;
+
+ xmalloc_set_program_name (progname);
/* Unlock the stdio streams. */
unlock_std_streams ();
gcc_init_libintl ();
+ diagnostic_initialize (global_dc, 0);
+
/* Handle response files. */
expandargv (&argc, &argv);
@@ -401,16 +411,6 @@ main (int argc, char **argv)
return 0;
}
-
-static void
-fnotice (FILE *file, const char *cmsgid, ...)
-{
- va_list ap;
-
- va_start (ap, cmsgid);
- vfprintf (file, _(cmsgid), ap);
- va_end (ap);
-}
/* Print a usage message and exit. If ERROR_P is nonzero, this is an error,
otherwise the output of --help. */