logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

assert.3p (2932B)


  1. '\" et
  2. .TH ASSERT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. assert
  12. \(em insert program diagnostics
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <assert.h>
  17. .P
  18. void assert(scalar \fIexpression\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIassert\fR()
  27. macro shall insert diagnostics into programs; it shall expand to a
  28. .BR void
  29. expression. When it is executed, if
  30. .IR expression
  31. (which shall have a
  32. .BR scalar
  33. type) is false (that is, compares equal to 0),
  34. \fIassert\fR()
  35. shall write information about the particular call that failed on
  36. .IR stderr
  37. and shall call
  38. \fIabort\fR().
  39. .P
  40. The information written about the call that failed shall include the
  41. text of the argument, the name of the source file, the source file line
  42. number, and the name of the enclosing function; the latter are,
  43. respectively, the values of the preprocessing macros _\|_FILE_\|_ and
  44. _\|_LINE_\|_
  45. and of the identifier _\|_func_\|_.
  46. .P
  47. Forcing a definition of the name NDEBUG,
  48. either from the compiler command line or with the preprocessor control
  49. statement
  50. .BR #define
  51. NDEBUG ahead of the
  52. .BR #include
  53. .IR <assert.h>
  54. statement, shall stop assertions from being compiled into the program.
  55. .SH "RETURN VALUE"
  56. The
  57. \fIassert\fR()
  58. macro shall not return a value.
  59. .SH ERRORS
  60. No errors are defined.
  61. .LP
  62. .IR "The following sections are informative."
  63. .SH EXAMPLES
  64. None.
  65. .SH "APPLICATION USAGE"
  66. None.
  67. .SH RATIONALE
  68. None.
  69. .SH "FUTURE DIRECTIONS"
  70. None.
  71. .SH "SEE ALSO"
  72. .IR "\fIabort\fR\^(\|)",
  73. .IR "\fIstdin\fR\^"
  74. .P
  75. The Base Definitions volume of POSIX.1\(hy2017,
  76. .IR "\fB<assert.h>\fP"
  77. .\"
  78. .SH COPYRIGHT
  79. Portions of this text are reprinted and reproduced in electronic form
  80. from IEEE Std 1003.1-2017, Standard for Information Technology
  81. -- Portable Operating System Interface (POSIX), The Open Group Base
  82. Specifications Issue 7, 2018 Edition,
  83. Copyright (C) 2018 by the Institute of
  84. Electrical and Electronics Engineers, Inc and The Open Group.
  85. In the event of any discrepancy between this version and the original IEEE and
  86. The Open Group Standard, the original IEEE and The Open Group Standard
  87. is the referee document. The original Standard can be obtained online at
  88. http://www.opengroup.org/unix/online.html .
  89. .PP
  90. Any typographical or formatting errors that appear
  91. in this page are most likely
  92. to have been introduced during the conversion of the source files to
  93. man page format. To report such errors, see
  94. https://www.kernel.org/doc/man-pages/reporting_bugs.html .