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]

Re: [cpplib] implement pragma dependancy


On Wed, Jun 21, 2000 at 01:28:41PM +0100, Nathan Sidwell wrote:
> Hi,
> this patch implements a new pragma.
>         #pragma dependancy "file" ...
>         #pragma dependancy <file> ...
> It searches for FILE, and then emits a warning, if FILE is newer than
> the current source file. The warning will include any trailing
> message.

I like the general idea.  Unfortunately I just rewrote
find_include_file() and friends to fix Jakub's bug with "" vs <>
includes - so if you can update your patch, after I commit the
changes, and resubmit, that would be nice.

I also have two nitpicks and a question for the group at large.  The
word is spelled dependency - three E's, no A.  I think the error
message would look better with a comma between "newer" and any
trailing text, e.g.

> foo.c:3:58: warning: source "/usr/include/foo.h" is newer, rerun fixincludes

C99 added a number of #pragmas.  These all begin with "STDC", e.g.

#pragma STDC FP_CONTRACT OFF

I wonder if it would be a good idea for any new pragmas we make up to
be name-spaced similarly.  We can't change the historical ones (once,
pack, interface, implementation, poison) but perhaps the new
#pragma system_header and your #pragma dependency should be 
#pragma GCC system_header and #pragma GCC dependency, or something
like that.

zw

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