|
warnings when using directors with multiple throw specifiers: msg#00186programming.swig
I have some virtual classes with throw specifiers that indicate multiple possible exceptions, such as this one: virtual void fromAdmin( const Message&, const SessionID& ) throw( FieldNotFound&, IncorrectDataFormat&, IncorrectTagValue&, RejectLogon& ) = 0; The code that is generated looks like this (for python): try { (arg1)->fromAdmin((FIX::Message const &)*arg2,(FIX::SessionID const &)*arg3); } catch(...) { throw; } catch(...) { throw; } catch(...) { throw; } catch(...) { throw; } Now this does not cause any errors (at least not in gcc 3.2, I can't speak for other compilers), but it does cause several warnings (since ... should be the last thing to be caught, and three of them are not last). With multiple directors which can have several methods like this, the warnings can add up. Of course this can make errors more difficult to spot. I would suggest that the generated code either look like so: try { (arg1)->fromAdmin((FIX::Message const &)*arg2,(FIX::SessionID const &)*arg3); } catch(FieldNotFound&) { throw; } catch(IncorrectDataFormat&) { throw; } catch(IncorrectTagValue&) { throw; } catch(RejectLogon&) { throw; } or just simply consolidated into: try { (arg1)->fromAdmin((FIX::Message const &)*arg2,(FIX::SessionID const &)*arg3); } catch(...) { throw; } On May 28, 2004, at 12:21 PM, David Beazley wrote: Marcelo Matus writes: _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: bug while wrapping const char arrays without an explicitly defined size: 00186, David Beazley |
|---|---|
| Next by Date: | Re: bug while wrapping const char arrays without an explicitly defined size: 00186, Marcelo Matus |
| Previous by Thread: | Re: bug while wrapping const char arrays without an explicitly defined sizei: 00186, David Beazley |
| Next by Thread: | Re: warnings when using directors with multiple throw specifiers: 00186, William S Fulton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |