summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 33b220a22c0..c844f08bc99 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4533,7 +4533,17 @@ main (argc, argv)
if (verbose_flag)
{
- if (! strcmp (version_string, compiler_version))
+ int n;
+
+ /* compiler_version is truncated at the first space when initialized
+ from version string, so truncate version_string at the first space
+ before comparing. */
+ for (n = 0; version_string[n]; n++)
+ if (version_string[n] == ' ')
+ break;
+
+ if (! strncmp (version_string, compiler_version, n)
+ && compiler_version[n] == 0)
fprintf (stderr, "gcc version %s\n", version_string);
else
fprintf (stderr, "gcc driver version %s executing gcc version %s\n",