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: PATCH: PR preprocessor/39533: -MM may list a header file twice


>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:

HJ> + Âunsigned int dir_len;

Tom> Should be size_t.

H.J.> I just use the same type as the len field in include/cpplib.h.

The rest of the files.c uses size_t for the results of strlen.

H.J.> There is a testcase in:
H.J.> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39533

I looked at this.  I don't think your patch is correct.  It works in
your one example, due to the ordering of -I options.  But if you
insert one, it will fail:

opsy. gcc -MM x.c -Iinclude            # works
x.o: x.c foo.h include/x.h include/y.h
opsy. gcc -MM x.c -IZ -Iinclude        # fails
x.o: x.c foo.h include/x.h include/y.h include/x.h


I don't know this code well enough to suggest an alternate
implementation.

Tom


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