[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH hurd 1/2] xxx print fail
From: |
Samuel Thibault |
Subject: |
Re: [PATCH hurd 1/2] xxx print fail |
Date: |
Sat, 4 Jun 2016 17:19:51 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
That looks useful, yes, please commit :)
Justus Winter, on Sat 04 Jun 2016 15:47:51 +0200, wrote:
> ---
> libshouldbeinlibc/assert-backtrace.c | 8 ++++++++
> libshouldbeinlibc/assert-backtrace.h | 6 ++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/libshouldbeinlibc/assert-backtrace.c
> b/libshouldbeinlibc/assert-backtrace.c
> index ca23c8d..72a49e9 100644
> --- a/libshouldbeinlibc/assert-backtrace.c
> +++ b/libshouldbeinlibc/assert-backtrace.c
> @@ -76,4 +76,12 @@ __assert_perror_fail_backtrace (int errnum,
>
> }
>
> +void
> +__print_fail_backtrace (const char *message, const char *file,
> + unsigned int line, const char *function)
> +{
> + __assert_fail_base_backtrace ("%s: %s:%u: %s: %s.\n",
> + message, file, line, function);
> +}
> +
> #endif /* ! defined NDEBUG */
> diff --git a/libshouldbeinlibc/assert-backtrace.h
> b/libshouldbeinlibc/assert-backtrace.h
> index c54b810..b36e5b2 100644
> --- a/libshouldbeinlibc/assert-backtrace.h
> +++ b/libshouldbeinlibc/assert-backtrace.h
> @@ -42,6 +42,12 @@ void __assert_perror_fail_backtrace (int errnum,
> const char *function)
> __attribute__ ((noreturn, unused));
>
> +/* Likewise, but prints the given MESSAGE. */
> +void
> +__print_fail_backtrace (const char *message, const char *file,
> + unsigned int line, const char *function)
> + __attribute__ ((noreturn, unused));
> +
> #define assert_backtrace(expr)
> \
> ((expr) \
> ? (void) 0
> \
> --
> 2.1.4
>
>
--
Samuel
Linux, c'est simple : ça s'adresse à une machine qui est parfois un peu
maraboutée mais qui d'habitude n'a pas d'états d'âme. Sur Usenet y'a
plein d'humains et de primates, et ça devient vraiment gore par moment.
-+- TP in : Guide du linuxien pervers - "Le linuxien a-t-il une âme ?" -+-
- RFC: Runtime checking of port handling, Justus Winter, 2016/06/04
- [PATCH hurd 1/2] xxx print fail, Justus Winter, 2016/06/04
- [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Justus Winter, 2016/06/04
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Ludovic Courtès, 2016/06/05
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Samuel Thibault, 2016/06/05
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Ludovic Courtès, 2016/06/06
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Thomas Schwinge, 2016/06/06
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Samuel Thibault, 2016/06/06
- Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros, Ludovic Courtès, 2016/06/06
Re: [PATCH hurd 1/2] xxx print fail,
Samuel Thibault <=
Re: RFC: Runtime checking of port handling, Samuel Thibault, 2016/06/04