diff options
author | mike <mike@FreeBSD.org> | 2001-10-27 20:11:10 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2001-10-27 20:11:10 +0000 |
commit | 186071821a5c388da21ab0a53f41dfb0eea24cf7 (patch) | |
tree | fa20a2f93c4614ce7747af799dd77a495d6132b3 /share/man/man3/assert.3 | |
parent | b37309f7648547e5c69ae317a1d73d8b631bd55f (diff) | |
download | FreeBSD-src-186071821a5c388da21ab0a53f41dfb0eea24cf7.zip FreeBSD-src-186071821a5c388da21ab0a53f41dfb0eea24cf7.tar.gz |
Only provide function information in compile environments that support
the C99 variable __func__ and never for C++. Provide a more meaningful
example in the assert(3) manual.
Reviewed by: asmodai, bde
Diffstat (limited to 'share/man/man3/assert.3')
-rw-r--r-- | share/man/man3/assert.3 | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/share/man/man3/assert.3 b/share/man/man3/assert.3 index bb23322..ec74ae3 100644 --- a/share/man/man3/assert.3 +++ b/share/man/man3/assert.3 @@ -72,22 +72,22 @@ as a macro .Xr cc 1 option .Fl D Ns Dv NDEBUG ) . -.Sh DIAGNOSTICS -The following diagnostic message is written to -.Em stderr -if -.Ar expression -is false: +.Sh EXAMPLES +The assertion: +.Bd -literal -offset indent +assert(1 == 0); +.Ed +.Pp +generates a diagnostic message similar to the following: .Bd -literal -offset indent -"assertion (%s) failed: function %s(), file %s:%d\en", \e - "expression", __func__, __FILE__, __LINE__); +assertion (1 == 0) failed: function main(), file assertion.c:100 .Ed .Sh SEE ALSO .Xr abort 3 .Sh STANDARDS The .Fn assert -macro confirms to +macro conforms to .St -isoC-99 . .Sh HISTORY An |