emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inlinable functions instead of macros


From: Stefan Monnier
Subject: Re: inlinable functions instead of macros
Date: Fri, 24 Aug 2012 22:05:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

> problems that make the macros hard to use.  They cannot be invoked
> from GDB, which complicates debugging.  More important, callers

Most of those macros don't need to be used from GDB (e.g. I've never
needed to use ASET from GDB).

> restriction makes callers error-prone.  We've tried to address some of
> the side-effect issues with this hack:

>    /* The IDX==IDX tries to detect when the macro argument is side-effecting. 
>  */
>    #define ASET(ARRAY, IDX, VAL)      \
>        (eassert ((IDX) == (IDX)),                             \

This should be removed indeed.  I added it temporarily and in any case
it doesn't work (e.g. "i++ == i++" will always return true in my
experience).

> +     Reimplement in terms of eassert_f, blv_found_f, set_blv_found_f.
> +     (eassert_f, blv_found_f, set_blv_found_f): New macros or functions,
> +     containing the guts of the old, but which let the caller specify
> +     file and line number.

I'd rather avoid these kinds of efforts,


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]