[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros |
Date: |
Sun, 05 Jun 2016 21:53:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Justus Winter <justus@gnupg.org> skribis:
> +#define Mach_port_check(NAME) \
> + void _Mach_port_check_##NAME(char *_unused[] __attribute__ ((unused))) \
> + { \
> + if (MACH_PORT_VALID (NAME)) \
> + __print_fail_backtrace (#NAME " leaked", \
> + __FILE__, __LINE__, "Port leak detector"); \
> + } \
> + char _Mach_port_check_x_##NAME[0] \
> + __attribute__ ((unused, cleanup (_Mach_port_check_##NAME)))
I think writing a GCC plug-in that would automatically add a cleanup
handler to automatic variables of type ‘mach_port_t’ wouldn’t be
unreasonable.
Ludo’.
- 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 <=
- 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, 2016/06/04
Re: RFC: Runtime checking of port handling, Samuel Thibault, 2016/06/04