This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Alternative to __FILE__/__LINE__
- From: François Dumont <frs dot dumont at gmail dot com>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 4 Mar 2018 21:18:52 +0100
- Subject: Alternative to __FILE__/__LINE__
- Authentication-results: sourceware.org; auth=none
Hi
Debug mode is using __FILE__/__LINE__ to show where the assertion
took place. So assertion looks like this:
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/debug/deque:175:
Error: function requires a valid iterator range [__first, __last).
But IMHO a smarter information would be to provide the file:line in
the source code that generated this assertion so that users could more
easily go to the faulty code.
So I am looking for __FILE__/__LINE__ equivalents pointing to the
first non-system source file. Has any such request already be made ? Do
you think it would worth a request to gcc guys ?
François