Re: GDB 7.99.91 MinGW compilation error in cli-script.c

Pedro Alves
2017-05-26T14:10:04Z

On 05/26/2017 02:02 PM, Eli Zaretskii wrote:
>> Cc: brobecker@adacore.com, simon.marchi@polymtl.ca, gdb-patches@sourceware.org
>> From: Pedro Alves <palves@redhat.com>
>> Date: Fri, 26 May 2017 11:54:03 +0100
>>
>>> The code says std::to_string, though. So it sounds like some coding
>>> conventions are being applied here of which I wasn't aware, and
>>> neither is Emacs. Are these conventions described somewhere?
>>
>> Just the standard GNU conventions. The code is defining a new
>> function template called gdb::to_string. Simplified:
>>
>> namespace gdb {
>> template <class T> std::string to_string (const T &val);
>> }
>>
>> There are two implementations of that, one for mingw, written
>> as a new function template in place. And another which is
>> importing std::to_string into the gdb namespace. But whatever
>> the implementations, it's implementation detail of gdb::to_string.
>
> So the convention is to include the full qualifier of every method?
> Including the namespace of the class? Does that include the whole
> chain of namespaces up to the root? If not, where does one stop?

I admit that I'm puzzled about you having an issue with
gdb::to_string, when your original entry said "(std::to_string)",
not "(to_string)".

I think the convention is to provide enough qualifiers to
to make it convenient to search/see what function was changed.
For class methods, I think we should include the class name,
otherwise it can get ambiguous. I'm fine with not mentioning
the namespace when otherwise it's obvious or redundant. E.g.,
if all of gdb was in namespace gdb [it's not], it'd probably not
make much sense to keep putting "gdb::" everywhere. But when
referring to a symbol outside gdb's namespace, I'd think it wise to
mention the namespace, so that it's clearer what the entry
is referring to.

>
>>> but once again, the convention to put the
>>> fully-qualified symbol name in the log entry should be documented, if
>>> it isn't already, because Emacs doesn't do that, at least not by
>>> default.
>>
>> I can't see how what Emacs does has any bearing here, since AFAIK,
>> Emacs isn't written in C++.
>
> I use Emacs commands, such as "C-x 4 a", to generate ChangeLog
> entries. Don't you do the same? Emacs add-log commands strip the
> class and namespace qualifiers.

Ah, I thought you were talking about your experience as emacs
maintainer. Sorry.

I never managed to get used to using emacs commands to write the ChangeLog.
I write ChangeLog entries manually, directly in the git commit log,
while scrolling through the diff, as last "self review" event, and
then copy over to the ChangeLog file at push time.

Thanks,
Pedro Alves