Mercurial > hg > octave-lyh
comparison src/error.cc @ 14042:57e19c30b7d6 stable
assume "all" "on" if "all" is not present in warning_state structure (bug #35050)
* error.cc (warning_enabled): If all_state is still -1 after looking
at the warning state structure, set it to 1 instead of having a panic
attack.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 13 Dec 2011 12:16:50 -0500 |
parents | 2c0765c14e4f |
children | 4000ad5fe0f6 |
comparison
equal
deleted
inserted
replaced
14041:6cb6e390e58c | 14042:57e19c30b7d6 |
---|---|
550 else | 550 else |
551 return -1; | 551 return -1; |
552 } | 552 } |
553 | 553 |
554 // For given warning ID, return 0 if warnings are disabled, 1 if | 554 // For given warning ID, return 0 if warnings are disabled, 1 if |
555 // enabled, and 2 if this ID should be an error instead of a warning. | 555 // enabled, and 2 if the given ID should be an error instead of a |
556 // warning. | |
556 | 557 |
557 int | 558 int |
558 warning_enabled (const std::string& id) | 559 warning_enabled (const std::string& id) |
559 { | 560 { |
560 int retval = 0; | 561 int retval = 0; |
596 if (all_found && id_found) | 597 if (all_found && id_found) |
597 break; | 598 break; |
598 } | 599 } |
599 } | 600 } |
600 | 601 |
602 // If "all" is not present, assume warnings are enabled. | |
601 if (all_state == -1) | 603 if (all_state == -1) |
602 panic_impossible (); | 604 all_state = 1; |
603 | 605 |
604 if (all_state == 0) | 606 if (all_state == 0) |
605 { | 607 { |
606 if (id_state >= 0) | 608 if (id_state >= 0) |
607 retval = id_state; | 609 retval = id_state; |