Project

General

Profile

Actions

Bug #7244

closed

EMG declares and operates with variables of types non-visible in the file with an entry point

Added by Ilja Zakharov over 8 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Environment models
Target version:
-
Start date:
05/24/2016
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

EMG chooses single file for an entry point function, control functions and label declarations. Label can be generated to represent resources which are relevant to callbacks from the other files of a module under verification. Referred labels can have type which is not visible in the main file of an environment model which causes incomplete type error.

This situation is already modelled in a test set for testing environment model specifications and can be easily reproduced.


Related issues 2 (0 open2 closed)

Related to Klever - Bug #6560: Determine incomplete types in the module scope ClosedIlja Zakharov01/28/2016

Actions
Related to Klever - Bug #7281: EMG generates variables with unknown sizeClosedIlja Zakharov06/08/2016

Actions
Actions #1

Updated by Ilja Zakharov over 8 years ago

The most reliable way is to use for process labels primitive types or pointers for more complicated types only. So I am going to implement casts to pointers for labels of all non-pointer complicated types. By the way additionally I will add automatic includes of header files given in interface categories specifications and if there are given then EMG will not do mentioned above casts. The latter case example is interrupt enum type which is used for interrupt return values and including of a corresponding header is a better solution.

Actions #2

Updated by Evgeny Novikov over 8 years ago

I would like to warn you to include additional headers very accurately, otherwise we will fall back into related #6560. I suggest that you can safely include appropriate headers if they are really required for corresponding interfaces in corresponding files. In particular you can specify required headers for corresponding interfaces directly in environment model specifications rather than include them unconditionally.

In addition using pointers instead of, say, structures can also fail since you will need at least corresponding structure declarations (something like struct A;) while they can absent without including corresponding headers.

Actions #3

Updated by Vadim Mutilin over 8 years ago

Idealy, we should be able to detect whether the structure is defined, declared or not. Based on this we should use the type itself, pointer to a type or void* correspondingly.
For now as far as we mostly use in specifications parameters and return values which are pointers to a declared structure type or simple type, the fix for #7262 should solve most of the cases.

Actions #4

Updated by Ilja Zakharov over 8 years ago

Since I cannot detect absence of a declaration in an entry point file, I am going to declare additionally all structures and unions to avoid warnings from a compiler.

Actions #5

Updated by Ilja Zakharov over 8 years ago

  • Priority changed from High to Urgent
Actions #6

Updated by Ilja Zakharov over 8 years ago

  • Priority changed from Urgent to Normal

As a workaround I have added export of control functions from the main file with an entry point to files with a container relevant to control function, callback call or kernel function call. This allowed to get rid of several problems relevant to scope and reported in relevant issues.

Implementation is available in emg-improvements branch.

Actions #7

Updated by Ilja Zakharov over 6 years ago

  • Status changed from New to Resolved

Moved to 8066-abstract-translator. Currently there is no any problems with the types scope.

Actions #8

Updated by Evgeny Novikov about 5 years ago

  • Status changed from Resolved to Closed

It seems that the branch was merged to master a long ago, but issues were not closed at that time.

Actions

Also available in: Atom PDF