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

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

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2007-08-31 00:03:17 CEST

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

> On 8/14/07, Daniel Rall <dlr@finemaltcoding.com> wrote:
>>
>> On Aug 14, 2007, at 2:38 AM, Lieven Govaerts wrote:
>>
>>> Quoting Erik Huelsmann <ehuels@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
Received on Thu Aug 30 23:53:22 2007

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