[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: cpp macro expansion for #pragmas
From:       Jakub Jelinek <jakub () redhat ! com>
Date:       2006-09-30 7:17:25
Message-ID: 20060930071724.GY20982 () devserv ! devel ! redhat ! com
[Download RAW message or body]

On Fri, Sep 29, 2006 at 06:40:29PM -0700, Ian Lance Taylor wrote:
> > This is revived from several months back.  It adds cpp macro expansion
> > capability for #pragma directives, under control of a gcc command line
> > option (-expand-pragmas).  It's against version 117267 of the svn
> > tree, which is now a day or so old, except the testsuite/ChangeLog
> > diff is against a newer revision (but changelogs always get patch
> > conflicts anyway).  I'd like to submit it for GCC 4.3.  I've run the
> > full gcc test suite and while there are a number of unexpected
> > failures and successes, they're in non-cpp-related areas and I get the
> > same failures when running the tests using the unpatched cpp (2
> > unexpected failures in C, one unexpected success in C++, and 16
> > unexpected failures in Fortran, IIRC.  I think Fortran does not use
> > the cpp at all).  Please let me know of any probs.
> 
> This is an interesting idea, but it seems to me that pragma expansion
> should itself be under the control of a pragma.  Otherwise you have
> program which will have surprisingly different behaviour depending
> upon the command line options used.  Is that doable?

libcpp already supports expansion/non-expansion on a per-pragma namespace
basis.  When registering a pragma with a namespace, you can say if it will
be macro expanded or not.  So, e.g. omp namespace is always macro expanded,
STDC namespace is not, pack namespace is expanded or not expanded depending
on the habits of the target for compatibility with other compilers on
the target, etc.  The namespace name itself is never expanded, which is
IMHO a good thing.

	Jakub
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic