# PetscUnlikelyDebug
Hints the compiler that the given condition is usually false, eliding the check in optimized mode 
## Synopsis
```
#include <petscmacros.h>
bool PetscUnlikelyDebug(bool cond)
```
Not Collective


## Input Parameters

- ***cond -*** Boolean expression



## Notes
Not available from Fortran, requires variadic macro support, definition is disabled by
defining `PETSC_SKIP_VARIADIC_MACROS`.

This returns the same truth value, it is only a hint to compilers that the result of cond is
likely to be false. When PETSc is compiled in optimized mode this will always return
false. Additionally, cond is guaranteed to not be evaluated when PETSc is compiled in
optimized mode.


## Example usage
This routine is shorthand for checking both the condition and whether PetscDefined(USE_DEBUG)
is true. So

```none
  if (PetscUnlikelyDebug(cond)) {
    foo();
  } else {
    bar();
  }
```


is equivalent to

```none
  if (PetscDefined(USE_DEBUG)) {
    if (PetscUnlikely(cond)) {
      foo();
    } else {
      bar();
    }
  } else {
    bar();
  }
```





## See Also
 `PetscUnlikely()`, `PetscLikely()`, `PetscCall()`, `SETERRQ`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscmacros.h.html#PetscUnlikelyDebug">include/petscmacros.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscmacros.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
