You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2007/08/30 22:03:17 UTC

[patch] Add -std=c89 to CFLAGS for gcc

On Aug 14, 2007, at 11:09 AM, Erik Huelsmann wrote:

> On 8/14/07, Daniel Rall <dl...@finemaltcoding.com> wrote:
>>
>> On Aug 14, 2007, at 2:38 AM, Lieven Govaerts wrote:
>>
>>> Quoting Erik Huelsmann <eh...@gmail.com>:
>>>
>>>> These breakage failures are caused by code-before-declaration  
>>>> errors
>>>> on my side; the first in three_way_merge() [line 164], the other in
>>>> two_way_diff() [line 257].
>>>>
>>>> In both cases, the line 'options = options ? options ...' needs  
>>>> to be
>>>> moved down below the immediate next block which declares
>>>> svn_string_t*
>>>> variables.
>>>>
>>>> I'm at work, so, if someone could commit this fix, buildbot can  
>>>> start
>>>> passing again.
>>>>
>>>> Thanks in advance!
>>>>
>>>> Bye,
>>>>
>>>> Erik.
>>>>
>>>> PS: Is there something in my CFLAGS I can set to prevent this kind
>>>> of error?
>>>
>>> Adding -std=c89 should have that effect.
>>
>> Is there any particular reason why we don't add this to Makefile by
>> default?
>
> Thanks for asking, because I was wondering the same thing. I think we
> should (when we detect GCC, that is).

How about this patch, then?

[[[
* configure.in
   (CFLAGS): Add -std=c89 when gcc is detected.
]]]

Index: configure.in
===================================================================
--- configure.in	(revision 26401)
+++ configure.in	(working copy)
@@ -25,6 +25,10 @@
# Look for a C compiler (before anything can set CFLAGS)
AC_PROG_CC
+if test "$GCC" = "yes"; then
+  CFLAGS="$CFLAGS -std=c89"
+fi
+
# Look for a C pre-processor
AC_PROG_CPP


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [patch] Add -std=c89 to CFLAGS for gcc

Posted by Eric Gillespie <ep...@google.com>.
Daniel Rall <dl...@finemaltcoding.com> writes:

> How about this patch, then?
> 
> [[[
> * configure.in
>    (CFLAGS): Add -std=c89 when gcc is detected.
> ]]]

+1 from me.  I avoid the problem by using gcc 2.95 (the last good
version! >hide from dannyb<).

> Index: configure.in
> ===================================================================
> --- configure.in	(revision 26401)
> +++ configure.in	(working copy)
> @@ -25,6 +25,10 @@
> # Look for a C compiler (before anything can set CFLAGS)
> AC_PROG_CC
> +if test "$GCC" = "yes"; then
> +  CFLAGS="$CFLAGS -std=c89"
> +fi
> +
> # Look for a C pre-processor
> AC_PROG_CPP
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [patch] Add -std=c89 to CFLAGS for gcc

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 30 Aug 2007, mark benedetto king wrote:

> 
> On Thu, Aug 30, 2007 at 03:03:17PM -0700, Daniel Rall wrote:
> > 
> >  On Aug 14, 2007, at 11:09 AM, Erik Huelsmann wrote:
> > 
> > > On 8/14/07, Daniel Rall <dl...@finemaltcoding.com> wrote:
> > >>
> > >> On Aug 14, 2007, at 2:38 AM, Lieven Govaerts wrote:
> > >>
> > >>> Quoting Erik Huelsmann <eh...@gmail.com>:
> > >>>
> 
> [...]
> 
> > >>>>
> > >>>> PS: Is there something in my CFLAGS I can set to prevent this kind
> > >>>> of error?
> > >>>
> > >>> Adding -std=c89 should have that effect.
> > >>
> > >> Is there any particular reason why we don't add this to Makefile by
> > >> default?
> > >
> > > Thanks for asking, because I was wondering the same thing. I think we
> > > should (when we detect GCC, that is).
> > 
> >  How about this patch, then?
> > 
> >  [[[
> >  * configure.in
> >    (CFLAGS): Add -std=c89 when gcc is detected.
> >  ]]]
> > 
> 
> This caused trouble in the past (see r11054).

Thanks Mark.  After some research and testing, I've backed out that
change in r27869.  It wasn't as helpful as hoped, and as a bonus,
broke the build of the Ruby bindings for me on Linux (FC6).

Re: [patch] Add -std=c89 to CFLAGS for gcc

Posted by mark benedetto king <mb...@lowlatency.com>.
On Thu, Aug 30, 2007 at 03:03:17PM -0700, Daniel Rall wrote:
> 
>  On Aug 14, 2007, at 11:09 AM, Erik Huelsmann wrote:
> 
> > On 8/14/07, Daniel Rall <dl...@finemaltcoding.com> wrote:
> >>
> >> On Aug 14, 2007, at 2:38 AM, Lieven Govaerts wrote:
> >>
> >>> Quoting Erik Huelsmann <eh...@gmail.com>:
> >>>

[...]

> >>>>
> >>>> PS: Is there something in my CFLAGS I can set to prevent this kind
> >>>> of error?
> >>>
> >>> Adding -std=c89 should have that effect.
> >>
> >> Is there any particular reason why we don't add this to Makefile by
> >> default?
> >
> > Thanks for asking, because I was wondering the same thing. I think we
> > should (when we detect GCC, that is).
> 
>  How about this patch, then?
> 
>  [[[
>  * configure.in
>    (CFLAGS): Add -std=c89 when gcc is detected.
>  ]]]
> 

This caused trouble in the past (see r11054).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org