You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Rolf Kalbermatter <ro...@cit.be> on 2006/02/07 13:50:15 UTC
Patch: Make HEAD compile with standard C compiler
A recent change causes problems when trying to compile with Visual C 6.
Variable declarations in functions need to be done before any code
statements in order to compile with standard C. This patch fixes this
issue in libsvn_ra_dav/file_revs.
Rolf Kalbermatter
CIT Engineering Nederland BV
Treubstraat 7H
2288 EG Rijswijk Tel: +31 (0)70 415 9190
The Netherlands Fax: +31 (0)70 415 9191
Re: Patch: Make HEAD compile with standard C compiler
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Wed, 8 Feb 2006, Daniel Berlin wrote:
> On Wed, 2006-02-08 at 18:18 -0800, Greg Stein wrote:
> > On Wed, Feb 08, 2006 at 03:38:42PM -0500, Daniel Berlin wrote:
> > > On Wed, 2006-02-08 at 17:00 +0000, Julian Foad wrote:
> > >...
> > > I'm used to bootstrapping gcc, where we have -Werror, -Wunused, etc on
> > > by default, so it catches this stuff for me :(
> > >
> > > I'm not sure why we don't do the same. We could rip the configure magic
> > > that detects whether it is supported or not by the compiler directly
> > > from gcc's configure.
> >
I think -Werror is problematic because different compiler versions warn
for different things. I've had problems with warnings in APR (or Apache)
headers, which I don't control. Making warnings break others built might
be too much.
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by Daniel Berlin <db...@dberlin.org>.
On Wed, 2006-02-08 at 18:18 -0800, Greg Stein wrote:
> On Wed, Feb 08, 2006 at 03:38:42PM -0500, Daniel Berlin wrote:
> > On Wed, 2006-02-08 at 17:00 +0000, Julian Foad wrote:
> >...
> > > May I recommend that developers using recent version of GCC add
> > >
> > > -Wdeclaration-after-statement
> > >
> > > to their CFLAGS.
> >
> > I'm used to bootstrapping gcc, where we have -Werror, -Wunused, etc on
> > by default, so it catches this stuff for me :(
> >
> > I'm not sure why we don't do the same. We could rip the configure magic
> > that detects whether it is supported or not by the compiler directly
> > from gcc's configure.
>
> We already detect GCC and add some special flags, so putting that one
> in should be a no-brainer. (line 489 of configure.in)
>
> Probably a little more difficult if we have to test GCC's version...
>
> Any others that would be good?
GCC actually uses -pedantic -Wno-long-long -Wno-variadic-macros
this sounds different than what it is:
# We want to use -pedantic, but we don't want warnings about
# * 'long long'
# * variadic macros
# So, we only use -pedantic if we can disable those warnings.
(IE it -Wno-<etc> disables those warnings)
>
> Cheers,
> -g
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by Greg Stein <gs...@lyra.org>.
On Wed, Feb 08, 2006 at 03:38:42PM -0500, Daniel Berlin wrote:
> On Wed, 2006-02-08 at 17:00 +0000, Julian Foad wrote:
>...
> > May I recommend that developers using recent version of GCC add
> >
> > -Wdeclaration-after-statement
> >
> > to their CFLAGS.
>
> I'm used to bootstrapping gcc, where we have -Werror, -Wunused, etc on
> by default, so it catches this stuff for me :(
>
> I'm not sure why we don't do the same. We could rip the configure magic
> that detects whether it is supported or not by the compiler directly
> from gcc's configure.
We already detect GCC and add some special flags, so putting that one
in should be a no-brainer. (line 489 of configure.in)
Probably a little more difficult if we have to test GCC's version...
Any others that would be good?
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by Daniel Berlin <db...@dberlin.org>.
On Wed, 2006-02-08 at 17:00 +0000, Julian Foad wrote:
> Malcolm Rowe wrote:
> > On Tue, Feb 07, 2006 at 02:50:15PM +0100, Rolf Kalbermatter wrote:
> >
> >>A recent change causes problems when trying to compile with Visual C 6.
> >>Variable declarations in functions need to be done before any code
> >>statements in order to compile with standard C. [...]
> >
> > Already fixed in r18380, yesterday, but thanks for the patch. [...]
>
> May I recommend that developers using recent version of GCC add
>
> -Wdeclaration-after-statement
>
> to their CFLAGS.
I'm used to bootstrapping gcc, where we have -Werror, -Wunused, etc on
by default, so it catches this stuff for me :(
I'm not sure why we don't do the same. We could rip the configure magic
that detects whether it is supported or not by the compiler directly
from gcc's configure.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by Julian Foad <ju...@btopenworld.com>.
Malcolm Rowe wrote:
> On Tue, Feb 07, 2006 at 02:50:15PM +0100, Rolf Kalbermatter wrote:
>
>>A recent change causes problems when trying to compile with Visual C 6.
>>Variable declarations in functions need to be done before any code
>>statements in order to compile with standard C. [...]
>
> Already fixed in r18380, yesterday, but thanks for the patch. [...]
May I recommend that developers using recent version of GCC add
-Wdeclaration-after-statement
to their CFLAGS.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Feb 07, 2006 at 02:50:15PM +0100, Rolf Kalbermatter wrote:
> A recent change causes problems when trying to compile with Visual C 6.
> Variable declarations in functions need to be done before any code
> statements in order to compile with standard C. This patch fixes this
> issue in libsvn_ra_dav/file_revs.
>
Already fixed in r18380, yesterday, but thanks for the patch. (I assume
you message was held up due to mailing list moderation).
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Fri, 10 Feb 2006, Martin v. Löwis wrote:
> Rolf Kalbermatter wrote:
> > A recent change causes problems when trying to compile with Visual C 6.
> > Variable declarations in functions need to be done before any code
> > statements in order to compile with standard C.
>
> Actually, standard C does support declarations after statements.
> You are referring to C89; the current standard (C99) has this feature.
> Of course, Visual C 6 doesn't support the current standard.
>
Subversion uses C89, FWIW. Probably mostly because of Visual C++, but
maybe other compilers as well.
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Patch: Make HEAD compile with standard C compiler
Posted by "Martin v. Löwis" <ma...@hpi.uni-potsdam.de>.
Rolf Kalbermatter wrote:
> A recent change causes problems when trying to compile with Visual C 6.
> Variable declarations in functions need to be done before any code
> statements in order to compile with standard C.
Actually, standard C does support declarations after statements.
You are referring to C89; the current standard (C99) has this feature.
Of course, Visual C 6 doesn't support the current standard.
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org