Defensive programming method based on function access global variables
A technology of global variables and programming methods, applied in program control design, electrical digital data processing, instruments, etc., can solve problems such as ignoring the safety of global variables
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Examples
Embodiment Construction
[0012] The present invention will be further described below in conjunction with embodiment.
[0013] A defensive programming method based on function access to global variables, combined with existing defensive programming methods to provide a more comprehensive defense of the software, it can also use the defensive programming method of functions to defend global variables, the specific steps include hiding The global variable name, the encapsulating global variable access function interface and the defense function of the global variable access function are respectively implemented as follows:
[0014] (1). Hide the name of the global variable; the declaration of the protected global variable does not appear in the referenced header file, and the definition file is provided as a binary file or the programming specification file stipulates that names other than the header file declaration cannot be used. The hiding of global variable names is done.
[0015] (2). Encapsulate...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More