This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Class-ify ptid_t
- From: Pedro Alves <palves at redhat dot com>
- To: Philipp Rudo <prudo at linux dot vnet dot ibm dot com>, Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 7 Apr 2017 11:48:43 +0100
- Subject: Re: [PATCH v2] Class-ify ptid_t
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8EA4D2E6050
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8EA4D2E6050
- References: <20170406190328.21103-1-simon.marchi@ericsson.com> <20170407112528.3f03fd37@ThinkPad>
On 04/07/2017 10:25 AM, Philipp Rudo wrote:
> In this context I ask myself what the error message is supposed to
> say (unfortunately you are the first one in GDB actually using it, all
> others only use an empty string). Is it what's expected ...
>
That's because the static assertion failure text includes both a
file:line indicating where's the failure, and modern gcc/clang
show you the line that failed, so it's not that big of a deal to
not include a message:
src/gdb/thread.c:1589:1: error: static assertion failed:
static_assert (1 == 0, "");
^
$
(and in C++17, static_assert got an overload with no second
parameter, even.)
>
> static_assert (pid == ptid_t (1, 0, 0), "pid operator== returned false")
>
>
> I tend more to what is expected.
Definitely it should say what is expected, just like regular
testsuite tests. Or say nothing when the expression is pretty clear
already, which works for me too. :-)
Thanks,
Pedro Alves