This is the mail archive of the gcc@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: How would *you* use an intern?


In article <3B156B14.11A07A4A@apple.com> you write:
>I've looked through the "projects for beginners" list, and while
>there are lots of interesting items, I was hoping for something
>that would help GCC be more useful with IDEs.  For instance, an
>easy thing might be to add some sort of structure to GCC's errors
>and warnings, perhaps something like GDB's MI interface or some
>sort of XML format, since Apple's IDE already uses XML for its
>project files.

As far as diagnostics go, I have a pet peeve of mine.
Often, gcc gives warnings when comparing signed to unsigned values,
in cases where the signed value *can't* possibly be negative.
It would be great if gcc could take advantages of assertions, in a limited
setting.

e.g., it shows up in code that looks like this:

char *s;
char *t;


...

assert(t-s >= 0); // assuming t and s point within the same array.
if (t-s < sizeof(buffer))
	memcpy(buffer, s, t-s);


This looks to me like it's not incredibly hard to do, a bit long to code,
probably, but would give one intern some good knowledge of the parser and
parse-tree.


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