[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inlinable functions instead of macros
From: |
Tom Tromey |
Subject: |
Re: inlinable functions instead of macros |
Date: |
Fri, 24 Aug 2012 19:38:09 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
>>>>> "Paul" == Paul Eggert <address@hidden> writes:
Paul> It's simple to put easserts into macros, but as you know this has
Paul> problems that make the macros hard to use. They cannot be invoked
Paul> from GDB, which complicates debugging.
Why is that? I haven't been following this, but I wonder if there is a
gdb deficiency we can easily address.
Paul> More important, callers sometimes cannot specify arguments with
Paul> side effects, and this restriction makes callers error-prone.
Paul> We've tried to address some of the side-effect issues with this
Paul> hack:
Paul> /* The IDX==IDX tries to detect when the macro argument is
side-effecting. */
Paul> #define ASET(ARRAY, IDX, VAL) \
Paul> (eassert ((IDX) == (IDX)), \
I've often wished that GCC had a __builtin_assert_no_side_effects for
use in macros.
Tom
- Re: C backtraces for Emacs, (continued)
- Re: C backtraces for Emacs, Paul Eggert, 2012/08/24
- Re: C backtraces for Emacs, Paul Eggert, 2012/08/25
- Re: C backtraces for Emacs, Eli Zaretskii, 2012/08/25
- Re: inlinable functions instead of macros, Paul Eggert, 2012/08/22
- Re: inlinable functions instead of macros, Andreas Schwab, 2012/08/22
- Re: inlinable functions instead of macros, Stefan Monnier, 2012/08/22
- Re: inlinable functions instead of macros, Paul Eggert, 2012/08/24
- Re: inlinable functions instead of macros,
Tom Tromey <=
- Re: inlinable functions instead of macros, Paul Eggert, 2012/08/24
- Re: inlinable functions instead of macros, Eli Zaretskii, 2012/08/25
- Re: inlinable functions instead of macros, Tom Tromey, 2012/08/25
- Re: inlinable functions instead of macros, Paul Eggert, 2012/08/26
- Re: inlinable functions instead of macros, Stefan Monnier, 2012/08/24
- Re: inlinable functions instead of macros, Paul Eggert, 2012/08/26
- Re: inlinable functions instead of macros, Eli Zaretskii, 2012/08/22
Re: inlinable functions instead of macros, Richard Stallman, 2012/08/18