All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: aliguori@us.ibm.com, Igor Mitsyanko <i.mitsyanko@samsung.com>,
	alexander_barabash@mentor.com, qemu-devel@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH qom-next] qom: make object cast assert if NULL object is passed as argument
Date: Mon, 04 Jun 2012 09:39:26 +0200	[thread overview]
Message-ID: <m3mx4ja5ld.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <4FC8BDC6.70804@suse.de> ("Andreas Färber"'s message of "Fri, 01 Jun 2012 15:04:06 +0200")

Andreas Färber <afaerber@suse.de> writes:

> Am 01.06.2012 13:18, schrieb Markus Armbruster:
>> Andreas Färber <afaerber@suse.de> writes:
>> 
>>> Am 31.05.2012 13:17, schrieb Igor Mammedov:
>>>> On 05/31/2012 12:16 PM, Paolo Bonzini wrote:
>>>>> Il 31/05/2012 10:30, Markus Armbruster ha scritto:
>>>>>>>> Makes much sense, but maybe it should be done in OBJECT() cast? Assert
>>>>>>>> when we do OBJECT(NULL).
>>>>>> In my opinion, OBJECT(p) where p is a null pointer is perfectly valid
>>>>>> and should yield a null pointer.
>>>>>
>>>>> Perhaps object_dynamic_cast and object_dynamic_cast_assert should do the
>>>>> same?
>>>>>
>>>>
>>>> or better object_dynamic_cast should return NULL if obj is NULL,
>>>> after all it's expected that it may return NULL
>>>
>>> That's what I was suggesting: I think that we should define "NULL is not
>>> of type TYPE_FOO" and thus have the ..._is_... functions return false,
>>> and have the ..._cast_assert assert.
>> 
>> Is it?
>
> See http://www.mail-archive.com/qemu-devel@nongnu.org/msg113922.html
>
>> Igor: object_dynamic_cast should return NULL if obj is NULL,
>> 
>> You: have the ..._cast_assert assert [on null argument, I presume]
>> 
>> Doesn't sound like the same suggestion to me :)
>
> I'll let you to your opinion. :) However, my opinion is that

My question isn't about a difference of opinions between us two.  It's
about Igor writing "X should do Y", and you replying "Yes, that's what I
was suggesting, X should do !Y".  There's a misunderstanding there, and
it could well be mine.  So I ask.

[...]

  reply	other threads:[~2012-06-04  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1338394747-17427-1-git-send-email-imammedo@redhat.com>
     [not found] ` <4FC6533C.3010207@samsung.com>
     [not found]   ` <m3k3zswy4r.fsf@blackfin.pond.sub.org>
     [not found]     ` <4FC744FE.3030203@redhat.com>
     [not found]       ` <4FC7533B.2060102@redhat.com>
2012-06-01  9:52         ` [Qemu-devel] [PATCH qom-next] qom: make object cast assert if NULL object is passed as argument Andreas Färber
2012-06-01 11:18           ` Markus Armbruster
2012-06-01 13:04             ` Andreas Färber
2012-06-04  7:39               ` Markus Armbruster [this message]
2012-06-04 13:14               ` Igor Mammedov
2012-06-01  9:57     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mx4ja5ld.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alexander_barabash@mentor.com \
    --cc=aliguori@us.ibm.com \
    --cc=i.mitsyanko@samsung.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.