File: violation.hc

package info (click to toggle)
craft 3.5-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,172 kB
  • ctags: 1,605
  • sloc: cpp: 3,794; makefile: 2,322; ansic: 857; sh: 842
file content (30 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>

#include "violation.h"

void __array_bounds_violation (char const *file_name,
                               int  line_number,
			       char const *array_name,
                               int  upper_bound,
			       char const *index_name,
                               int  bad_index)

 {printf ("%s (cc=%d,hc=", file_name, line_number);
  fflush (stdout);
  print_hc;
  printf (") : %s [%s == %d] out of [0..%d]\n",
          array_name,
          index_name,
          bad_index,
          upper_bound);
  abort ();

.  print_hc
     {char cmd [128];

      sprintf (cmd, "cc2hc %s %d", file_name, line_number);
      system  (cmd);
     }.

  }