[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] pkl: make PK_UNREACHABLE more verbose
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [PATCH v2] pkl: make PK_UNREACHABLE more verbose |
Date: |
Tue, 14 Feb 2023 21:26:09 +0100 |
Hi Jose.
On Tue, Feb 14, 2023 at 09:21:33PM +0100, Jose E. Marchesi wrote:
> > +
> > /* Diagnoses reaching unreachable code, and aborts. */
> > -#define PK_UNREACHABLE() \
> > - do \
> > - { \
> > - assert (0 && "Reached unreachable code."); \
> > - abort (); \
> > - } \
> > - while (0)
> > +#define PK_UNREACHABLE() pk_unreachable (__func__, __FILE__, __LINE__)
>
> Is it really __func__ and not __FUNC__?
> Is that portable?
According to the ISO/IEC 9899:201x (n1570.pdf) in section
6.4.2.2 Predefined identifiers:
> The identifier __func__ shall be implicitly declared by the translator
as if immediately following the opening brace of each function definition,
the declaration
static const char __func__[] = "function-name";
appeared, where function-name is the name of the lexically-enclosing function.
Regards,
Mohammad-Reza
Re: [RFC][PATCH] pkl: make PK_UNREACHABLE more verbose, Jose E. Marchesi, 2023/02/13
Re: [RFC][PATCH] pkl: make PK_UNREACHABLE more verbose, Arsen Arsenović, 2023/02/14