Skip to contentSkip to conversation

Dynamic construction of SmPL constraints

Cocci SF Markus Elfring 2 participants 4 messages Dec 23, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

I try to extract data and filter on properties from various function implementations.
Now I would like to clarify consequences from the name resolution process of the C programming language a bit more for safer development of semantic patches.

Implementations from separate directories can provide different properties. It can occasionally happen that functions from different folders have got the same name.

I see that there are some development challenges when I would like to construct SmPL constraints in the way that they will take the directory hierarchy for a source file into account.
How can this functionality be achieved?

Regards,
Markus

#1 lore raw
Quoted 8 lines · SF Markus Elfring

Hello,

I try to extract data and filter on properties from various function implementations.
Now I would like to clarify consequences from the name resolution process of the C programming language a bit more for safer development of semantic patches.

Quoted 8 lines

Implementations from separate directories can provide different properties. It can occasionally happen that functions from different folders have got the same name.

I see that there are some development challenges when I would like to construct SmPL constraints in the way that they will take the directory hierarchy for a source file into account.
How can this functionality be achieved?

You always have the file name information available in a position variable.

Without knowing concretely what you want to do that is the only suggestion that I have.

julia

#2 lore raw
Quoted 10 lines
Quoted 4 lines

I see that there are some development challenges when I would like to construct SmPL constraints in the way that they will take the directory hierarchy for a source file into account.
How can this functionality be achieved?

You always have the file name information available in a position variable.

Without knowing concretely what you want to do that is the only suggestion that I have.

I try to prepare my semantic patches for name space issues with the C programming language. A few of my SmPL approaches should be applicable in general ways so that I can avoid efforts at other places.

It seems that SmPL constraints are set up at start of the program "spatch". I imagine that more fine-tuning will help to achieve safer and better handling of relevant background information at the moment when a concrete source file should be analysed.
The directory hierarchy should influence the identifier selection somehow, shouldn't it?

Regards,
Markus

#3 lore raw
Quoted 15 lines · SF Markus Elfring
Quoted 10 lines
Quoted 4 lines

I see that there are some development challenges when I would like to construct SmPL constraints in the way that they will take the directory hierarchy for a source file into account.
How can this functionality be achieved?

You always have the file name information available in a position variable.

Without knowing concretely what you want to do that is the only suggestion that I have.

I try to prepare my semantic patches for name space issues with the C programming language. A few of my SmPL approaches should be applicable in general ways so that I can avoid efforts at other places.

Quoted 6 lines

It seems that SmPL constraints are set up at start of the program "spatch". I imagine that more fine-tuning will help to achieve safer and better handling of relevant background information at the moment when a concrete source file should be analysed.
The directory hierarchy should influence the identifier selection somehow, shouldn't it?

I'm not sure that this is a reasonable direction of thought. There can be multiple definitions in some directories that are used in completely disjoint directories. On the other hand, a single file can have multiple definitions of the same function.

julia