SECURITY(FEATURE)

 C/C++ programming language is so flexible that it often causes program or system to crash. Cint tries to introduce security mode to provide safer way of using C/C++ interpreter.

HOW TO SET SECURITY MODE
 Security mode can be set either by command line option or #pragma statement. -q [level] : command line option
 You can specify security level by '-q' command line option like below.
	$ cint -qlevel1 source.C
If you initialize cint by G__init_cint(), you can do the same,
	G__init_cint("cint -qlevel1");
Security mode can be overridden by '#pragma security' statement described below in specific source file. #pragma security [level]
 In source file, '#pragma security [level]' can be used to set security mode. Security mode set by this is only active in this particular file and files included by it. You can control different security levels for each independent source file.
	#pragma security level2
It is not recommended to overuse this feature. Having different security levels for different source files may not provide safe enough environment.

SECURITY MODE
 There are several levels of security modes. A user can trade off security and C/C++ compatibility by choosing appropriate security level. The higher the security level the safer the environment at a cost of loosing some language capability. 0 (zero)
 Security 0 is a default setting of cint which does no security and robustness checking. However, following checks are always activated in cint.
	* Array index out of range
		int a[10];
		a[-5] = a[10];   // checked
	* Divided by zero
		double a, d = 0;
		a = 3.14/d;      // checked
	* Invalid arguments for standard library function
		double d=log(-1.0);  // checked
		FILE *fp = NULL;
		fprintf(fp,NULL);    // checked
level0
 Security level0 checks following thing.
	* Function call stack deeper than 100
		f() {
		   f();  // infinite stack grow checked
		}
level1
 Security level1 does following on top of level0.
	* Prohibits Pointer arithmetic
		int *p,i;
		p = &i + 2; // checked
	* Prohibits Cast to pointer and incompatible pointer assignment
		char c;
		int *p = (int*)c; // checked
		p = malloc(sizeof(int)); //  checked, use new
	* Prohibits Goto statement
		label1:
		   goto label;  // checked
	* Activate Garbage collection
		See also garbage(2)
level2
 Security level2 does following on top of level1.
	* Prohibits using pointer as an array
		int *a = &i;
		a[5] = 1234;  // checked
		f(int *a) {
		   a[10]=123; // checked, sorry
		}             // need to use array class or template
level3
 Security level3 does following on top of level2.
	* Prohibits casting
		double d;
		int i;
		i = (int)d;  // checked
level4-6
 Security level4 through 6 are reserved for experimental use.

SEE ALSO
    garbage(2),cint(1),makecint(1)

AUTHOR
Masaharu Goto Copyright (c) 1995~1999 Masaharu Goto