This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Solaris pragma macro expansion
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> --- GCC.orig/gcc/doc/extend.texi 2004-11-05 01:22:46.000000000 +0000
> +++ GCC/gcc/doc/extend.texi 2004-11-19 16:36:59.000000000 +0000
> @@ -8603,7 +8603,7 @@
>
> Increase the minimum alignment of each @var{variable} to @var{alignment}.
> This is the same as GCC's @code{aligned} attribute @pxref{Variable
> -Attributes}).
> +Attributes}). Macro expansion occurs on the arguments to this pragma.
This is inaccurate - expansion only happens on some targets (currently
only Solaris) and only in C (which is considered a bug). Please
clarify.
> +@defmac HANDLE_PRAGMA_PACK_WITH_EXPANSION
> +Define this macro (to a value of 1), as well as
> +@code{HANDLE_SYSV_PRAGMA}, if macros should be expanded in the
> +arguments of @samp{#pragma pack}.
> +@end defmac
Inconsistency - you actually defined it to nothing.
> @@ -1176,7 +1185,11 @@ do_pragma (cpp_reader *pfile)
> numbers in place. */
> if (pfile->cb.line_change)
> (*pfile->cb.line_change) (pfile, pragma_token, false);
> + if (p->allow_expansion && !pfile->state.in_deferred_pragma)
> + pfile->state.prevent_expansion--;
> (*p->u.handler) (pfile);
> + if (p->allow_expansion && !pfile->state.in_deferred_pragma)
> + pfile->state.prevent_expansion++;
> }
> else
> {
Needs a comment explaining why expansion is never done in deferred
pragmas.
Otherwise OK.
zw