.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" 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 "15 Septiembre 2017" GNU "Manual del Programador de Linux" .SH NOMBRE assert \- aborta el programa si la expresión es falsa .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; lb lb lb l l l. Interfaz Atributo Valor T{ \fBassert\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" .\" See Defect Report 107 for more details. POSIX.1\-2001, POSIX.1\-2008, C89, C99. 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) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .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 . 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. 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 .