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

Go to the source code of this file.

Functions

void sc_error (char *name, char *fmt,...)
 package sc More...
 

Function Documentation

◆ sc_error()

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

package sc

void sc_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). SC_ERROR should be called as:

SC_ERROR(function_name, format, expression-list)

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

print name of function causing error

print out remainder of message

create a core file for debug

Definition at line 46 of file sc_error.c.

47 {
48  va_list args;
49 
50  va_start(args, fmt);
51 
52  /* print name of function causing error */
53  (void) fprintf(stderr, "sc error in %s: ", name);
54 
55  /* print out remainder of message */
56  (void) vfprintf(stderr, fmt, args);
57  va_end(args);
58 
59  /* create a core file for debug */
60  (void) abort();
61 }
#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().

+ Here is the call graph for this function: