.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" Modified Sat Jul 24 21:42:42 1993 by Rik Faith .\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond .\" Modified Thu Jun 2 23:44:11 2016 by Nikos Mavrogiannopoulos .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH assert 3 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE assert \- aborta el programa si la expresión es falsa .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBvoid assert(scalar \fP\fIexpression\fP\fB);\fP .fi .SH DESCRIPCIÓN This macro can help programmers find bugs in their programs, or handle exceptional cases via a crash that will produce limited debugging output. .PP If \fIexpression\fP is false (i.e., compares equal to zero), \fBassert\fP() prints an error message to standard error and terminates the program by calling \fBabort\fP(3). The error message includes the name of the file and function containing the \fBassert\fP() call, the source code line number of the call, and the text of the argument; something like: .PP .in +4n .EX prog: some_file.c:16: some_func: Assertion \`val == 0\[aq] failed. .EE .in .PP If the macro \fBNDEBUG\fP is defined at the moment \fI\fP was last included, the macro \fBassert\fP() generates no code, and hence does nothing at all. It is not recommended to define \fBNDEBUG\fP if using \fBassert\fP() to detect error conditions since the software may behave non\-deterministically. .SH "VALOR DEVUELTO" No se devuelve ningún valor. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBassert\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH ESTÁNDARES C11, POSIX.1\-2008. .SH HISTORIAL C89, C99, POSIX.1\-2001. .PP .\" See Defect Report 107 for more details. In C89, \fIexpression\fP is required to be of type \fIint\fP and undefined behavior results if it is not, but in C99 it may have any scalar type. .SH ERRORES \fBassert\fP() es implementada como un macro; si la expresión comprobada tiene efectos laterales, el comportamiento del programa puede ser diferente dependiendo de si \fBNDEBUG\fP está definida o no. Esto puede crear fallos indeterminados (Heisenbugs) que no se dan cuando la depuración está activada. .SH "VÉASE TAMBIÉN" \fBabort\fP(3), \fBassert_perror\fP(3), \fBexit\fP(3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Sebastian Desimone , Carlos Costa Portela y Miguel Pérez Ibars . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .