From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove some variables in favor of using gdb::optional
Date: Fri, 23 Aug 2019 20:23:00 -0000 [thread overview]
Message-ID: <dfe31179-19eb-d905-8f03-e64dfa552774@redhat.com> (raw)
In-Reply-To: <5994de6e-cb4b-2ec2-f6f9-1ee41da1827e@polymtl.ca>
On 8/23/19 8:52 PM, Simon Marchi wrote:
> On 2019-08-23 3:47 p.m., Pedro Alves wrote:
>> On 8/23/19 8:33 PM, Simon Marchi wrote:
>>> On 2019-08-23 11:35 a.m., Pedro Alves wrote:
>>
>>>> Would you like to run with this?
>>>
>>> So I wasn't sure about what the third state should be. I think it depends on
>>> the particular context. In different contexts, it could mean "unknown", "unspecified",
>>> "auto", "don't care", etc. There's no one-size word that fits all case, so I don't really
>>> like the idea of having just one word and have it represent poorly what we actually mean.
>>>
>>> That lead me to think, if we want to represent three states and if the states are
>>> specific to each use case, why not just define an enum and be explicit about it?
>>
>> That's a very good point actually. I agree and I'm convinced.
>>
>> Let's shelve the tribool idea until/if we find a better use for it.
>>
>>>
>>> A bit like why I prefer defining an explicit type with two fields rather than using
>>> std::pair: the "first" and "second" members are not very descriptive.
>>
>> Right, agreed, the fact that std::map/std::unordered_map searching returns pairs
>> is one of those things I hate the most about C++.
>>
>>> Here's a patch that does that. What do you think?
>>
>> I think I like it!
>
> Yay, less work for me! I'll run it through the buildbot and push it if it's all good.
Sorry for the delayed nit, but the first time I didn't really pay attention
the the enumerator names you were using. Reading back, I notice that you
used "dynamic". I don't know what that means here? Don't you mean
"external", as opposed to static? Like, wouldn't this be more to the point?
enum {
symbol_linkage_unknown,
symbol_linkage_static,
symbol_linkage_extern,
} symbol_linkage = symbol_linkage_unknown;
Thanks,
Pedro Alves
next prev parent reply other threads:[~2019-08-23 20:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 20:10 Simon Marchi
2019-08-04 21:21 ` Tom Tromey
2019-08-05 2:39 ` Simon Marchi
2019-08-05 4:09 ` Tom Tromey
2019-08-21 19:38 ` Pedro Alves
2019-08-22 0:44 ` Simon Marchi
2019-08-22 23:36 ` Simon Marchi
2019-08-23 15:35 ` Pedro Alves
2019-08-23 19:33 ` Simon Marchi
2019-08-23 19:47 ` Pedro Alves
2019-08-23 19:53 ` Simon Marchi
2019-08-23 20:23 ` Pedro Alves [this message]
2019-08-23 22:24 ` Simon Marchi
2019-08-23 22:25 ` Simon Marchi
2019-08-24 11:23 ` Ruslan Kabatsayev
2019-08-24 23:56 ` Simon Marchi
2019-08-25 22:35 ` Simon Marchi
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=dfe31179-19eb-d905-8f03-e64dfa552774@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox