PIPS
error.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+ Include dependency graph for error.c:

Go to the source code of this file.

Functions

void contrainte_error (char *name, char *fmt,...)
 package contrainte More...
 

Function Documentation

◆ contrainte_error()

void contrainte_error ( char *  name,
char *  fmt,
  ... 
)

package contrainte

error.c

INTLIBRARY void contrainte_error(va_dcl va_alist) should be called to terminate execution and to core dump when data structures are corrupted or when an undefined operation is requested (zero divide for instance). CONTRAINTE_ERROR should be called as:

CONTRAINTE_ERROR(function_name, format, expression-list)

where function_name is a string containing the name of the function calling CONTRAINTE_ERROR, and where format and expression-list are passed as arguments to vprintf. CONTRAINTE_ERROR terminates execution with abort. ARARGS0

print name of function causing error

print out remainder of message

create a core file for debug

Parameters
nameame
fmtmt

Definition at line 49 of file error.c.

50 {
51  va_list args;
52 
53  va_start(args, fmt);
54 
55  /* print name of function causing error */
56  (void) fprintf(stderr, "contrainte error in %s: ", name);
57 
58  /* print out remainder of message */
59  (void) vfprintf(stderr, fmt, args);
60  va_end(args);
61 
62  /* create a core file for debug */
63  (void) abort();
64 }
#define abort()
Definition: misc-local.h:53
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References abort, and fprintf().

Referenced by contrainte_sprint_format(), and contrainte_text_format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: