This is the mail archive of the gcc-patches@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: C++ PATCH: Fix PR 13275


Maybe it just me....

> + @smallexample
> +   __offsetof__ (expression)
> + @end smallexample
> + 
> + is equivalent to the parenthesized expression, except that the
> + expression is considered an integral constant expression even if it
> + contains certain operators that are not normally permitted in an
> + integral constant expression.  Users should never use
> + @code{__offsetof__} directly; the only valid use of
> + @code{__offsetof__} is to implement the @code{offsetof} macro in
> + @code{<stddef.h>}.

.. but I would expect an __offsetof__ built-in to actually implement
offsetof and just forcing some expression to be consider an integral
constant expression.

i.e.

#define offsetof(x) (__offsetof__(x))

This built-in really is __force_constant_expression__

Jan




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