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: [C++ PATCH]: warning on implicit float->int


Nathan Sidwell <nathan@codesourcery.com> writes:

[...]

| 
| This passing of the context for diagnostics is awkward, and IMO the wrong
| thing. 

Agreed.

! ... In convert_for_initialization we need the same thing, and we
| have the hack of saving the error count, calling the functions and then
| seeing if we issued any errors, and if so emit some context. Ug!
| I think the right thing is to implement a little context stack for diagnostics
| which we can push closures onto. Then when emitting a diagnostic we simply
| invoke the top closure to generate the context information. No need to keep
| passing the stuff around or saving error counts. Does that sound good?

I would prefer not to waste resource on this stuff.  I would prefer a
recursive descent parser (isn't there a plan to rewrite the parser?).
At that point we'll have the context.

Currently I'm working on turning cp/error.c and cp/errfn.c into
something less awkward to work with.  We'll pass cp_thing an
output_buffer plus other useful flags for formatting purpose; we might
as well pass other data.  The patch won't be ready before Monday
because I'll be out till Monday morning.

| 
| > I'm not sure I agree.  I haven't seen any complaints about this particular
| > warning.
| Ok.
| 
| Is this one ok? comments about the context stack idea?

Maybe it is time to start to reimplement the parser.  Mark, Jason?

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

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