This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Class-ify ptid_t


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]