qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmis


From: Daniel Jacobowitz
Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes
Date: Tue, 12 Aug 2008 08:24:04 -0400
User-agent: Mutt/1.5.17 (2008-05-11)

On Mon, Aug 11, 2008 at 02:22:16PM -0500, Anthony Liguori wrote:
> But this tosses a warning since void (*)() is deprecated.  So, if we use:
>
> void dispatch(void *func, int n_args, void *args)
>
> It'll work just like it did before.

Just for the record: while you're correct this will work on mainstream
systems (you've been saying modern, which is not accurate), it is not
valid C.  The C standard only permits conversions between pointers to
different object types, or between pointers to different function
types.  Pointers can also be converted to integers but "the result
need not be in the range of values of any integer type".

GCC will even warn about it:
  ISO C forbids conversion of object pointer to function pointer type

-- 
Daniel Jacobowitz
CodeSourcery




reply via email to

[Prev in Thread] Current Thread [Next in Thread]