Mercurial > octave
comparison libinterp/corefcn/error.h @ 30726:4feb63a3a51c
maint: silence compiler warning about unused parameter when -DNDEBUG used.
* error.h (panic_if, error_if): Add #else clause with octave_unused_parameter
call so that no compilation warning is emitted.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 08 Feb 2022 15:35:39 -0800 |
parents | 53b125563b49 |
children | db8735ee84da e88a07dec498 |
comparison
equal
deleted
inserted
replaced
30725:0cf772732981 | 30726:4feb63a3a51c |
---|---|
514 #ifndef NDEBUG | 514 #ifndef NDEBUG |
515 if (cond) | 515 if (cond) |
516 panic_impossible (); | 516 panic_impossible (); |
517 else | 517 else |
518 return; | 518 return; |
519 | |
520 #else | |
521 octave_unused_parameter (cond); | |
519 #endif | 522 #endif |
520 } | 523 } |
521 | 524 |
522 inline void | 525 inline void |
523 panic_unless (bool cond) | 526 panic_unless (bool cond) |
534 #ifndef NDEBUG | 537 #ifndef NDEBUG |
535 if (cond) | 538 if (cond) |
536 error_impossible (); | 539 error_impossible (); |
537 else | 540 else |
538 return; | 541 return; |
542 | |
543 #else | |
544 octave_unused_parameter (cond); | |
539 #endif | 545 #endif |
540 } | 546 } |
541 | 547 |
542 inline void | 548 inline void |
543 error_unless (bool cond) | 549 error_unless (bool cond) |