<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hello,<br></div><div><br></div><div>I want to manage errors with CHKERRQ macro in void functions.<br></div><div><br></div><div>I do not want to use CHKERRV.<br></div><div>I prefer to modify void functions so that they return an error code.<br></div><div><br></div><div>However, it seems CHKERRQ returns a value in case of failure only.<br></div><div>Example below does not seem to compile without warning (Wreturn-type flag):<br></div><div><br></div><div><div>--------------------------</div><div>PetscErrorCode foo()</div><div>{</div><div>    PetscErrorCode code = somePetscFunction();</div><div>    CHKERRQ(code);</div>}</div><div>--------------------------<br></div><div><br></div><div>I guess I need to return a success code like this:<br></div><div><br></div><div><div><div>--------------------------</div><div>PetscErrorCode foo()</div><div>{</div><div>    PetscErrorCode code = somePetscFunction();</div><div>    CHKERRQ(code);</div><div>    return PETSC_SUCCESS_CODE;<br></div>}</div>--------------------------</div><div><br></div><div>However, I do not know the value of the success code of Petsc.</div><div>I guess it is zero but I would prefer to use a macro sucha as PETSC_SUCCESS_CODE in the above example.<br></div><div>Does such a macro exist?<br></div><div><br></div><div>Best,<br></div><div><br></div><div>Cédric<br></div><div><br></div><div><br></div></div></body></html>