:orphan:
# 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)
```
No Fortran Support

Not Collective


## Input Parameter

- ***cond -*** Boolean expression





## Note
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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
