diff mbox

[1/9] build: disable Wstrict-prototypes

Message ID 1361231825-12037-2-git-send-email-aliguori@us.ibm.com
State New
Headers show

Commit Message

Anthony Liguori Feb. 18, 2013, 11:56 p.m. UTC
GTK won't build with strict-prototypes due to gtkitemfactory.h:

    /* We use () here to mean unspecified arguments. This is deprecated
     * as of C99, but we can't change it without breaking compatibility.
     * (Note that if we are included from a C++ program () will mean
     * (void) so an explicit cast will be needed.)
     */
    typedef	void	(*GtkItemFactoryCallback)  ();

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kevin Wolf Feb. 20, 2013, 11:31 a.m. UTC | #1
On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
> GTK won't build with strict-prototypes due to gtkitemfactory.h:
> 
>     /* We use () here to mean unspecified arguments. This is deprecated
>      * as of C99, but we can't change it without breaking compatibility.
>      * (Note that if we are included from a C++ program () will mean
>      * (void) so an explicit cast will be needed.)
>      */
>     typedef	void	(*GtkItemFactoryCallback)  ();
> 
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index bf5970f..74d5878 100755
> --- a/configure
> +++ b/configure
> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>  # default flags for all hosts
>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>  if test "$debug_info" = "yes"; then

Other places wrap the inclusion of problematic headers in '#pragma GCC
diagnostic ...' instead of globally disabling warnings.

Kevin
Markus Armbruster Feb. 20, 2013, 2:30 p.m. UTC | #2
Kevin Wolf <kwolf@redhat.com> writes:

> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>> 
>>     /* We use () here to mean unspecified arguments. This is deprecated
>>      * as of C99, but we can't change it without breaking compatibility.
>>      * (Note that if we are included from a C++ program () will mean
>>      * (void) so an explicit cast will be needed.)
>>      */
>>     typedef	void	(*GtkItemFactoryCallback)  ();
>> 
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>> ---
>>  configure | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/configure b/configure
>> index bf5970f..74d5878 100755
>> --- a/configure
>> +++ b/configure
>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>  # default flags for all hosts
>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>  if test "$debug_info" = "yes"; then
>
> Other places wrap the inclusion of problematic headers in '#pragma GCC
> diagnostic ...' instead of globally disabling warnings.

I'd hate to lose -Wstrict-prototypes globally.
Laszlo Ersek Feb. 20, 2013, 2:50 p.m. UTC | #3
On 02/20/13 12:31, Kevin Wolf wrote:
> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>>
>>     /* We use () here to mean unspecified arguments. This is deprecated
>>      * as of C99, but we can't change it without breaking compatibility.
>>      * (Note that if we are included from a C++ program () will mean
>>      * (void) so an explicit cast will be needed.)
>>      */
>>     typedef	void	(*GtkItemFactoryCallback)  ();
>>
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>> ---
>>  configure | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index bf5970f..74d5878 100755
>> --- a/configure
>> +++ b/configure
>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>  # default flags for all hosts
>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>  if test "$debug_info" = "yes"; then
> 
> Other places wrap the inclusion of problematic headers in '#pragma GCC
> diagnostic ...' instead of globally disabling warnings.

Available only in gcc-4.6+:

http://gcc.gnu.org/gcc-4.6/changes.html

Laszlo
Kevin Wolf Feb. 20, 2013, 2:57 p.m. UTC | #4
On Wed, Feb 20, 2013 at 03:50:11PM +0100, Laszlo Ersek wrote:
> On 02/20/13 12:31, Kevin Wolf wrote:
> > On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
> >> GTK won't build with strict-prototypes due to gtkitemfactory.h:
> >>
> >>     /* We use () here to mean unspecified arguments. This is deprecated
> >>      * as of C99, but we can't change it without breaking compatibility.
> >>      * (Note that if we are included from a C++ program () will mean
> >>      * (void) so an explicit cast will be needed.)
> >>      */
> >>     typedef	void	(*GtkItemFactoryCallback)  ();
> >>
> >> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> >> ---
> >>  configure | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/configure b/configure
> >> index bf5970f..74d5878 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
> >>  # default flags for all hosts
> >>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
> >>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
> >> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
> >> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
> >>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
> >>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
> >>  if test "$debug_info" = "yes"; then
> > 
> > Other places wrap the inclusion of problematic headers in '#pragma GCC
> > diagnostic ...' instead of globally disabling warnings.
> 
> Available only in gcc-4.6+:
> 
> http://gcc.gnu.org/gcc-4.6/changes.html

I think this is mostly the push/pop part. We avoid it for this reason
and just unconditionally make it error after including the header file.
The pragma is also only enabled by a configure check.

Have a look at include/ui/qemu-pixman.h or coroutine-ucontext.c for an
example.

Kevin
Laszlo Ersek Feb. 20, 2013, 3:33 p.m. UTC | #5
On 02/20/13 15:57, Kevin Wolf wrote:
> On Wed, Feb 20, 2013 at 03:50:11PM +0100, Laszlo Ersek wrote:
>> On 02/20/13 12:31, Kevin Wolf wrote:
>>> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>>>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>>>>
>>>>     /* We use () here to mean unspecified arguments. This is deprecated
>>>>      * as of C99, but we can't change it without breaking compatibility.
>>>>      * (Note that if we are included from a C++ program () will mean
>>>>      * (void) so an explicit cast will be needed.)
>>>>      */
>>>>     typedef	void	(*GtkItemFactoryCallback)  ();
>>>>
>>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>> ---
>>>>  configure | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index bf5970f..74d5878 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>>>  # default flags for all hosts
>>>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>>>  if test "$debug_info" = "yes"; then
>>>
>>> Other places wrap the inclusion of problematic headers in '#pragma GCC
>>> diagnostic ...' instead of globally disabling warnings.
>>
>> Available only in gcc-4.6+:
>>
>> http://gcc.gnu.org/gcc-4.6/changes.html
> 
> I think this is mostly the push/pop part. We avoid it for this reason
> and just unconditionally make it error after including the header file.
> The pragma is also only enabled by a configure check.
> 
> Have a look at include/ui/qemu-pixman.h or coroutine-ucontext.c for an
> example.

Yes, I checked those before posting. Two points:

(a) #pragma PP_TOKEN1 PP_TOKEN2 ..., where PP_TOKEN1 is not STDC, has
implementation-defined effect. (Ie. the platform can do whatever it
wants, but has to document it). Non-STDC #pragmas that are not
recognized by the implementation must be ignored (C99 6.10.6p1
requirement). So wrapping "#pragma GCC diagnostic" is not really useful:
non-gcc compilers will surely not recognize "#pragma GCC whatever", and
an older gcc (not recognizing "#pragma GCC diagnostic") is required to
ignore it.

(b) My main point was, if you build on a gcc which understands
-Wstrict-prototypes and chokes on gtkitemfactory.h, but doesn't
understand the #pragma, then compilation will fail.

I think that on such a platform "qemu-pixman.h" / <pixman.h> from
pixman-0.16.0 would fail to parse as well.

What am I not understanding? :)

Thanks
Laszlo
Kevin Wolf Feb. 20, 2013, 3:44 p.m. UTC | #6
On Wed, Feb 20, 2013 at 04:33:50PM +0100, Laszlo Ersek wrote:
> On 02/20/13 15:57, Kevin Wolf wrote:
> > On Wed, Feb 20, 2013 at 03:50:11PM +0100, Laszlo Ersek wrote:
> >> On 02/20/13 12:31, Kevin Wolf wrote:
> >>> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
> >>>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
> >>>>
> >>>>     /* We use () here to mean unspecified arguments. This is deprecated
> >>>>      * as of C99, but we can't change it without breaking compatibility.
> >>>>      * (Note that if we are included from a C++ program () will mean
> >>>>      * (void) so an explicit cast will be needed.)
> >>>>      */
> >>>>     typedef	void	(*GtkItemFactoryCallback)  ();
> >>>>
> >>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> >>>> ---
> >>>>  configure | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/configure b/configure
> >>>> index bf5970f..74d5878 100755
> >>>> --- a/configure
> >>>> +++ b/configure
> >>>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
> >>>>  # default flags for all hosts
> >>>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
> >>>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
> >>>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
> >>>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
> >>>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
> >>>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
> >>>>  if test "$debug_info" = "yes"; then
> >>>
> >>> Other places wrap the inclusion of problematic headers in '#pragma GCC
> >>> diagnostic ...' instead of globally disabling warnings.
> >>
> >> Available only in gcc-4.6+:
> >>
> >> http://gcc.gnu.org/gcc-4.6/changes.html
> > 
> > I think this is mostly the push/pop part. We avoid it for this reason
> > and just unconditionally make it error after including the header file.
> > The pragma is also only enabled by a configure check.
> > 
> > Have a look at include/ui/qemu-pixman.h or coroutine-ucontext.c for an
> > example.
> 
> Yes, I checked those before posting. Two points:
> 
> (a) #pragma PP_TOKEN1 PP_TOKEN2 ..., where PP_TOKEN1 is not STDC, has
> implementation-defined effect. (Ie. the platform can do whatever it
> wants, but has to document it). Non-STDC #pragmas that are not
> recognized by the implementation must be ignored (C99 6.10.6p1
> requirement). So wrapping "#pragma GCC diagnostic" is not really useful:
> non-gcc compilers will surely not recognize "#pragma GCC whatever", and
> an older gcc (not recognizing "#pragma GCC diagnostic") is required to
> ignore it.

gcc produces a warning for unknown pragmas, and -Werror turns it into an
error, so it's not quite useless.

> (b) My main point was, if you build on a gcc which understands
> -Wstrict-prototypes and chokes on gtkitemfactory.h, but doesn't
> understand the #pragma, then compilation will fail.
> 
> I think that on such a platform "qemu-pixman.h" / <pixman.h> from
> pixman-0.16.0 would fail to parse as well.

I think you're right here. When I originally introduced the first one of
these, I had to deal with a new warning in 4.6, so this was obviously
not a problem. But qemu-pixman.h as well as this one can't rely on it.

Maybe we need to remove -Werror if configure detects that the #pragma
doesn't work.

Kevin
Laszlo Ersek Feb. 20, 2013, 4:05 p.m. UTC | #7
On 02/20/13 16:44, Kevin Wolf wrote:
> On Wed, Feb 20, 2013 at 04:33:50PM +0100, Laszlo Ersek wrote:

>> (a) #pragma PP_TOKEN1 PP_TOKEN2 ..., where PP_TOKEN1 is not STDC, has
>> implementation-defined effect. (Ie. the platform can do whatever it
>> wants, but has to document it). Non-STDC #pragmas that are not
>> recognized by the implementation must be ignored (C99 6.10.6p1
>> requirement). So wrapping "#pragma GCC diagnostic" is not really useful:
>> non-gcc compilers will surely not recognize "#pragma GCC whatever", and
>> an older gcc (not recognizing "#pragma GCC diagnostic") is required to
>> ignore it.
> 
> gcc produces a warning for unknown pragmas, and -Werror turns it into an
> error, so it's not quite useless.

(To be quashed with -Wno-unknown-pragmas ;))

>> (b) My main point was, if you build on a gcc which understands
>> -Wstrict-prototypes and chokes on gtkitemfactory.h, but doesn't
>> understand the #pragma, then compilation will fail.
>>
>> I think that on such a platform "qemu-pixman.h" / <pixman.h> from
>> pixman-0.16.0 would fail to parse as well.
> 
> I think you're right here. When I originally introduced the first one of
> these, I had to deal with a new warning in 4.6, so this was obviously
> not a problem. But qemu-pixman.h as well as this one can't rely on it.
> 
> Maybe we need to remove -Werror if configure detects that the #pragma
> doesn't work.

Sounds good to me. I assume developers (who should care the most about
warnings) work with recent toolstacks (in RHEL-6.3 for example,
devtoolset-1.1 ships gcc-4.7.2 (+patches)), hence the #pragma would work
for them. For users building qemu on an older toolstack (where the
#pragma would not be recognized and suppress the warning) the warning
should not be fatal.

Clang was also mentioned, I'm not sure about it. I suppose clang wishes
to be UI-compatible with gcc (that's why it supports the -W* options),
so maybe they'll pick up the #pragma too in time?...

Thanks
Laszlo
Markus Armbruster Feb. 20, 2013, 4:10 p.m. UTC | #8
Kevin Wolf <kwolf@redhat.com> writes:

[...]
> Maybe we need to remove -Werror if configure detects that the #pragma
> doesn't work.

Sounds sensible to me.
Anthony Liguori Feb. 20, 2013, 4:24 p.m. UTC | #9
Markus Armbruster <armbru@redhat.com> writes:

> Kevin Wolf <kwolf@redhat.com> writes:
>
>> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>>> 
>>>     /* We use () here to mean unspecified arguments. This is deprecated
>>>      * as of C99, but we can't change it without breaking compatibility.
>>>      * (Note that if we are included from a C++ program () will mean
>>>      * (void) so an explicit cast will be needed.)
>>>      */
>>>     typedef	void	(*GtkItemFactoryCallback)  ();
>>> 
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>> ---
>>>  configure | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/configure b/configure
>>> index bf5970f..74d5878 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>>  # default flags for all hosts
>>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>>  if test "$debug_info" = "yes"; then
>>
>> Other places wrap the inclusion of problematic headers in '#pragma GCC
>> diagnostic ...' instead of globally disabling warnings.
>
> I'd hate to lose -Wstrict-prototypes globally.

This goes away in GTK3 which a lot of people already have.  I don't want
to do it in this series but I will add GTK3 support and detecting it via
configure.  If we can use GTK3 instead of GTK2, we can avoid disabling
this warning.

I need to update my laptop to a newer distro first as I haven't yet made
the Gnome 3 plunge...

Regards,

Anthony Liguori
Markus Armbruster Feb. 22, 2013, 10:40 a.m. UTC | #10
Markus Armbruster <armbru@redhat.com> writes:

> Kevin Wolf <kwolf@redhat.com> writes:
>
>> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>>> 
>>>     /* We use () here to mean unspecified arguments. This is deprecated
>>>      * as of C99, but we can't change it without breaking compatibility.
>>>      * (Note that if we are included from a C++ program () will mean
>>>      * (void) so an explicit cast will be needed.)
>>>      */
>>>     typedef	void	(*GtkItemFactoryCallback)  ();
>>> 
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>> ---
>>>  configure | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/configure b/configure
>>> index bf5970f..74d5878 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>>  # default flags for all hosts
>>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>>  if test "$debug_info" = "yes"; then
>>
>> Other places wrap the inclusion of problematic headers in '#pragma GCC
>> diagnostic ...' instead of globally disabling warnings.
>
> I'd hate to lose -Wstrict-prototypes globally.

We just lost it: commit 22bc9a46 :(
Anthony Liguori Feb. 22, 2013, 1:28 p.m. UTC | #11
Markus Armbruster <armbru@redhat.com> writes:

> Markus Armbruster <armbru@redhat.com> writes:
>
>> Kevin Wolf <kwolf@redhat.com> writes:
>>
>>> On Mon, Feb 18, 2013 at 05:56:57PM -0600, Anthony Liguori wrote:
>>>> GTK won't build with strict-prototypes due to gtkitemfactory.h:
>>>> 
>>>>     /* We use () here to mean unspecified arguments. This is deprecated
>>>>      * as of C99, but we can't change it without breaking compatibility.
>>>>      * (Note that if we are included from a C++ program () will mean
>>>>      * (void) so an explicit cast will be needed.)
>>>>      */
>>>>     typedef	void	(*GtkItemFactoryCallback)  ();
>>>> 
>>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>> ---
>>>>  configure | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>> 
>>>> diff --git a/configure b/configure
>>>> index bf5970f..74d5878 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -283,7 +283,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
>>>>  # default flags for all hosts
>>>>  QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
>>>>  QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
>>>> -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>>> +QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
>>>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>>>  QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
>>>>  if test "$debug_info" = "yes"; then
>>>
>>> Other places wrap the inclusion of problematic headers in '#pragma GCC
>>> diagnostic ...' instead of globally disabling warnings.
>>
>> I'd hate to lose -Wstrict-prototypes globally.
>
> We just lost it: commit 22bc9a46 :(

We'll get it back shortly once we add GTK3 support.  I expect that to
happen before 1.5.

Regards,

Anthony Liguori
diff mbox

Patch

diff --git a/configure b/configure
index bf5970f..74d5878 100755
--- a/configure
+++ b/configure
@@ -283,7 +283,7 @@  sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
-QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
 QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
 QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
 if test "$debug_info" = "yes"; then