diff mbox

[6/7] Add -Wold-style-declaration -Wold-style-definition to QEMU_CFLAGS

Message ID 83add4094da4dd3ddd50d849623f658e93e482c0.1253661009.git.quintela@redhat.com
State Superseded
Headers show

Commit Message

Juan Quintela Sept. 22, 2009, 11:19 p.m. UTC
ANSI c89 has been with us for a while.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Laurent Desnogues Sept. 23, 2009, 8:48 a.m. UTC | #1
On Wed, Sep 23, 2009 at 1:19 AM, Juan Quintela <quintela@redhat.com> wrote:
> ANSI c89 has been with us for a while.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  configure |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 62dccd2..81b9ba8 100755
> --- a/configure
> +++ b/configure
> @@ -1648,6 +1648,7 @@ if test "$debug" = "no" ; then
>  fi
>  QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>  QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
> +QEMU_CFLAGS="-Wold-style-declaration -Wold-style-definition $QEMU_CFLAGS"

Some older versions of gcc don't handle -Wold-style-declaration.
For instance gcc 4.1.2.


Laurent

>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>  QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS"
>  QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS"
> --
> 1.6.2.5
>
>
>
>
Markus Armbruster Sept. 23, 2009, 4:09 p.m. UTC | #2
Laurent Desnogues <laurent.desnogues@gmail.com> writes:

> On Wed, Sep 23, 2009 at 1:19 AM, Juan Quintela <quintela@redhat.com> wrote:
>> ANSI c89 has been with us for a while.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  configure |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 62dccd2..81b9ba8 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1648,6 +1648,7 @@ if test "$debug" = "no" ; then
>>  fi
>>  QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>> +QEMU_CFLAGS="-Wold-style-declaration -Wold-style-definition $QEMU_CFLAGS"
>
> Some older versions of gcc don't handle -Wold-style-declaration.
> For instance gcc 4.1.2.

Pretty old, do we want to support it?  If yes, make configure detect
whether the warning works?
Blue Swirl Sept. 23, 2009, 5:16 p.m. UTC | #3
On Wed, Sep 23, 2009 at 7:09 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Laurent Desnogues <laurent.desnogues@gmail.com> writes:
>
>> On Wed, Sep 23, 2009 at 1:19 AM, Juan Quintela <quintela@redhat.com> wrote:
>>> ANSI c89 has been with us for a while.
>>>
>>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>>> ---
>>>  configure |    1 +
>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index 62dccd2..81b9ba8 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -1648,6 +1648,7 @@ if test "$debug" = "no" ; then
>>>  fi
>>>  QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>>  QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>> +QEMU_CFLAGS="-Wold-style-declaration -Wold-style-definition $QEMU_CFLAGS"
>>
>> Some older versions of gcc don't handle -Wold-style-declaration.
>> For instance gcc 4.1.2.
>
> Pretty old, do we want to support it?  If yes, make configure detect
> whether the warning works?

Yes, OpenBSD uses 3.3.5 (propolice).

There are already similar checks for linker flags in configure, new
checks for warnings available would allow a different set of flags for
the latest and greatest GCC and the good old ones.
Juan Quintela Sept. 29, 2009, 11:15 p.m. UTC | #4
Blue Swirl <blauwirbel@gmail.com> wrote:
> On Wed, Sep 23, 2009 at 7:09 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Laurent Desnogues <laurent.desnogues@gmail.com> writes:
>>
>>> On Wed, Sep 23, 2009 at 1:19 AM, Juan Quintela <quintela@redhat.com> wrote:
>>>> ANSI c89 has been with us for a while.
>>>>
>>>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>>>> ---
>>>>  configure |    1 +
>>>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 62dccd2..81b9ba8 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -1648,6 +1648,7 @@ if test "$debug" = "no" ; then
>>>>  fi
>>>>  QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>>>  QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>>> +QEMU_CFLAGS="-Wold-style-declaration -Wold-style-definition $QEMU_CFLAGS"
>>>
>>> Some older versions of gcc don't handle -Wold-style-declaration.
>>> For instance gcc 4.1.2.
>>
>> Pretty old, do we want to support it?  If yes, make configure detect
>> whether the warning works?
>
> Yes, OpenBSD uses 3.3.5 (propolice).
>
> There are already similar checks for linker flags in configure, new
> checks for warnings available would allow a different set of flags for
> the latest and greatest GCC and the good old ones.

Fixed in new series just sent.  It detects in configure if flags exists.

Thanks for the review, Juan.
diff mbox

Patch

diff --git a/configure b/configure
index 62dccd2..81b9ba8 100755
--- a/configure
+++ b/configure
@@ -1648,6 +1648,7 @@  if test "$debug" = "no" ; then
 fi
 QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wold-style-declaration -Wold-style-definition $QEMU_CFLAGS"
 QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
 QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS"
 QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS"