This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: statement expressions and extended asm bug?


Gabriel Dos Reis wrote:
> | Perhaps this is a flaw in GCC's implementation of
> | statement-expression, because s-e is intended for use in macros
> | function-like macros -- whose callers don't know they are calling a
> | macro.
> 
> Well, that is called inline functions :-)

Yes, but as the primary reason for statement expressions is to make
macros that can be called like functions, and there are vast numbers
of macros written using that assumption, perhaps the preferred semantic
is that they behave like it :)

> If you consistently and predictably inline functions, people won't
> ddamage their codes and run into troubles -- even if "they asked for it". 

Yes.
That is preferable now that the inliner is better than it used to be.

There are still cases where inline isn't a feasible replacement, such
as function-like macros in C which can work with more than one type of
argument.  The GCC manual has precisely such an example.

-- Jamie


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]