qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign)
@ 2008-09-12 19:56 Blue Swirl
  2008-09-12 20:59 ` M. Warner Losh
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2008-09-12 19:56 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 121 bytes --]

Hi,

GCC 4 enables -Wpointer-sign if -Wall is enabled. This trivial patch
suppresses the warnings. Comments? Objections?

[-- Attachment #2: fix_signed_warnings.diff --]
[-- Type: plain/text, Size: 24496 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign)
  2008-09-12 19:56 [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign) Blue Swirl
@ 2008-09-12 20:59 ` M. Warner Losh
  2008-09-13  6:38   ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: M. Warner Losh @ 2008-09-12 20:59 UTC (permalink / raw)
  To: qemu-devel, blauwirbel

In message: <f43fc5580809121256i1d15c407vbebbfc8cd081cb43@mail.gmail.com>
            "Blue Swirl" <blauwirbel@gmail.com> writes:
: GCC 4 enables -Wpointer-sign if -Wall is enabled. This trivial patch
: suppresses the warnings. Comments? Objections?

Don't you mean 'fix' the warnings, since this patch looks like it
tries to cast things to be correct...

Warner

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign)
  2008-09-12 20:59 ` M. Warner Losh
@ 2008-09-13  6:38   ` Blue Swirl
  2008-09-13 17:02     ` Blue Swirl
  0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2008-09-13  6:38 UTC (permalink / raw)
  To: M. Warner Losh; +Cc: qemu-devel

On 9/12/08, M. Warner Losh <imp@bsdimp.com> wrote:
> In message: <f43fc5580809121256i1d15c407vbebbfc8cd081cb43@mail.gmail.com>
>             "Blue Swirl" <blauwirbel@gmail.com> writes:
>  : GCC 4 enables -Wpointer-sign if -Wall is enabled. This trivial patch
>
> : suppresses the warnings. Comments? Objections?
>
>
> Don't you mean 'fix' the warnings, since this patch looks like it
>  tries to cast things to be correct...

Well, some parts of the patch actually fix the types so that they are
more consistent, the casts just silence the warnings. A real fix would
be to change the types but then it would be incorrect to change the
signed types just to match the unsigned loadvm/savevm API.

Now that I think of it, the API could be extended with signed
versions. That would be best in terms of type safety. Maybe I'll try
that approach instead.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign)
  2008-09-13  6:38   ` Blue Swirl
@ 2008-09-13 17:02     ` Blue Swirl
  0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2008-09-13 17:02 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]

On 9/13/08, Blue Swirl <blauwirbel@gmail.com> wrote:
> On 9/12/08, M. Warner Losh <imp@bsdimp.com> wrote:
>  > In message: <f43fc5580809121256i1d15c407vbebbfc8cd081cb43@mail.gmail.com>
>  >             "Blue Swirl" <blauwirbel@gmail.com> writes:
>  >  : GCC 4 enables -Wpointer-sign if -Wall is enabled. This trivial patch
>  >
>  > : suppresses the warnings. Comments? Objections?
>  >
>  >
>  > Don't you mean 'fix' the warnings, since this patch looks like it
>  >  tries to cast things to be correct...
>
>
> Well, some parts of the patch actually fix the types so that they are
>  more consistent, the casts just silence the warnings. A real fix would
>  be to change the types but then it would be incorrect to change the
>  signed types just to match the unsigned loadvm/savevm API.
>
>  Now that I think of it, the API could be extended with signed
>  versions. That would be best in terms of type safety. Maybe I'll try
>  that approach instead.

The first patch adds signed versions. This cleans up some parts
because casts are no longer needed.

The second patch fixes other warnings by making the types more
consistent, like before.

[-- Attachment #2: signed_savevm_api.diff --]
[-- Type: plain/text, Size: 18109 bytes --]

[-- Attachment #3: fix_signed_warnings.diff --]
[-- Type: plain/text, Size: 21174 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-13 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-12 19:56 [Qemu-devel] [PATCH][RFC] Fix gcc 4.x warnings (-Wpointer-sign) Blue Swirl
2008-09-12 20:59 ` M. Warner Losh
2008-09-13  6:38   ` Blue Swirl
2008-09-13 17:02     ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).