Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8dd2ede

Browse files
committed
Improve compiler string shown in version()
With some compilers such as Clang and ICC emulating GCC, using a version string of the form "GCC $version" can be quite misleading. Also, a great while ago, the version output from gcc --version started including the string "gcc", so it is redundant to repeat that. In order to support ancient GCC versions, we now prefix the result with "GCC " only if the version output does not start with a letter.
1 parent d2088ae commit 8dd2ede

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

configure

+2-1
Original file line numberDiff line numberDiff line change
@@ -29704,7 +29704,8 @@ $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
2970429704

2970529705
# Create compiler version string
2970629706
if test x"$GCC" = x"yes" ; then
29707-
cc_string="GCC `${CC} --version | sed q`"
29707+
cc_string=`${CC} --version | sed q`
29708+
case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
2970829709
elif test x"$SUN_STUDIO_CC" = x"yes" ; then
2970929710
cc_string=`${CC} -V 2>&1 | sed q`
2971029711
else

configure.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,8 @@ AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
18491849

18501850
# Create compiler version string
18511851
if test x"$GCC" = x"yes" ; then
1852-
cc_string="GCC `${CC} --version | sed q`"
1852+
cc_string=`${CC} --version | sed q`
1853+
case $cc_string in [[A-Za-z]]*) ;; *) cc_string="GCC $cc_string";; esac
18531854
elif test x"$SUN_STUDIO_CC" = x"yes" ; then
18541855
cc_string=`${CC} -V 2>&1 | sed q`
18551856
else

0 commit comments

Comments
 (0)