assert(3) Library Functions Manual assert(3) NOMBRE assert - aborta el programa si la expresion es falsa BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include void assert(scalar expression); DESCRIPCION This macro can help programmers find bugs in their programs, or handle exceptional cases via a crash that will produce limited debugging output. If expression is false (i.e., compares equal to zero), assert() prints an error message to standard error and terminates the program by calling abort(3). The error message includes the name of the file and function containing the assert() call, the source code line number of the call, and the text of the argument; something like: prog: some_file.c:16: some_func: Assertion `val == 0' failed. If the macro NDEBUG is defined at the moment was last included, the macro assert() generates no code, and hence does nothing at all. It is not recommended to define NDEBUG if using assert() to detect error conditions since the software may behave non-deterministically. VALOR DEVUELTO No se devuelve ningun valor. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-----------------------------+--------------------+-------------------+ |Interfaz | Atributo | Valor | +-----------------------------+--------------------+-------------------+ |assert() | Seguridad del hilo | Multi-hilo seguro | +-----------------------------+--------------------+-------------------+ ESTANDARES C11, POSIX.1-2008. HISTORIAL C89, C99, POSIX.1-2001. In C89, expression is required to be of type int and undefined behavior results if it is not, but in C99 it may have any scalar type. ERRORES assert() es implementada como un macro; si la expresion comprobada tiene efectos laterales, el comportamiento del programa puede ser diferente dependiendo de si NDEBUG esta definida o no. Esto puede crear fallos indeterminados (Heisenbugs) que no se dan cuando la depuracion esta activada. VEASE TAMBIEN abort(3), assert_perror(3), exit(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Sebastian Desimone , Carlos Costa Portela y Miguel Perez Ibars Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de manual de Linux 6.06 31 Octubre 2023 assert(3)