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]: Fix problematic -Wcast-qual cases using new CONST_CAST macro


> It would do, if it was finished.  I don't know where that stands.
> Perhaps DJ could give us an update.

It got bogged down in arguments about how expression-specific warning
settings would work, and inlined functions with different warning
sets.  Then it got into statement-specific warning changesets and
deltas.  We never got around to implementing any of the compromises.

Currently, you can wrap a function with the pragmas and sometimes it
works the way you want, especially if you disable whole-file
optimizations and tree inlining ;-)

Thus, we only allow (I don't know if it's enforced) the pragmas before
the first function definition.

I think technically we can keep track of the changes efficiently, if
we have "change point" data structures that have the warning number,
new action, and a pointer to the previous change point.  That's 12
bytes per #pragma, with a little more work when you actually print a
message (to follow the chain back to find the most recent change for
that warning, or to the beginning, where we use the master table).

That also allows us to push/pop by just starting a new chain at some
previous change point.  Scoping would do the same thing.  No need for
forward pointers, just the back pointers.

The hard part is mapping a "where" in the code with a "where" in the
change point chain.


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