[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [BUG] "-std=c90" passed to non-GCC compilers

From: Branko Čibej <brane_at_wandisco.com>
Date: Thu, 15 Aug 2013 22:48:12 +0200

On 15.08.2013 21:08, Daniel Richard G. wrote:
> I am building Subversion 1.8.1 on Solaris 10 on AMD64, using the vendor
> compiler. All of the compile lines produce a warning from the compiler:
>
> /bin/bash /tmp/subversion-build/libtool --tag=CC --silent --mode=compile cc -std=c90 -D__EXTENSIONS__ -D_REENTRANT -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS [...]
> cc: Warning: illegal option -d=c90
>
>
> The -std=c90 flag appears to be added by the SVN_CC_MODE_SETUP() macro
> in build/ac-macros/compiler.m4. This then uses SVN_CFLAGS_ADD_IFELSE(),
> which checks to see if the compiler accepts a specified flag. This macro
> assumes that the compiler will throw an error if it doesn't recognize a
> flag,

Indeed it does so assume ...

> which unfortunately does not hold true in the case of the Sun
> compiler and this -std= flag.
>
> According to "cc -flags", -s is "Strip symbol table from the executable
> file". The cc(1) man page states "cc recognizes -a, -e, -r, -t, -u, and
> -z and passes these options and their arguments to ld. cc also passes
> any unrecognized options to ld with a warning."
>
> Perhaps the macro should check the value of $GCC before testing
> this flag?

Clearly it should. I was kind of hoping that wouldn't be necessary, but
compilers differ too much in how they handle unknown options. Note that
we already have a workaround for clang for the same issue, but I doubt
we can rely on a similar workaround for Sun CC (and all the other myriad
compilers out there).

Thanks for the report, I'll look into fixing this.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2013-08-15 22:51:47 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.