Skip to contentSkip to conversation

Source code analysis for header files

Cocci SF Markus Elfring 3 participants 11 messages Dec 31, 2014 – Jan 25, 2015 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Dear Julia,

Can the tool "spatch" be instructed anyhow to analyse only header files (*.h) instead of the usual source files (*.c) after the parameter "--dir" was passed?

Regards,
Markus

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.10.1412311439380.2559@hadrien

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.10.1412311457130.2559@hadrien

#4 lore raw
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Can the tool "spatch" be instructed anyhow to analyse only header files (*.h) instead of the usual source files (*.c) after the parameter "--dir" was passed?

No.

Thanks for your clarification.

Will it eventually be quicker to determine the list of header files by other software tools?

Much quicker.

How do you think about an approach just to change the file name extension from ".c" to ".h" occasionally? Are there any more use cases around where
it makes also sense to search for source files with other suffixes?

Regards,
Markus

#5 lore raw
Quoted 5 lines

How do you think about an approach just to change the file name extension from ".c" to ".h" occasionally? Are there any more use cases around where
it makes also sense to search for source files with other suffixes?

How easy (or challenging) is it to treat more files as source files from the C programming language?

Would you like to extend use cases for your source code analysis and transformation software in this design direction?

Regards,
Markus

#6 lore raw
Quoted 11 lines · SF Markus Elfring
Quoted 5 lines

How do you think about an approach just to change the file name extension from ".c" to ".h" occasionally? Are there any more use cases around where
it makes also sense to search for source files with other suffixes?

How easy (or challenging) is it to treat more files as source files from the C programming language?

Would you like to extend use cases for your source code analysis and transformation software in this design direction?

There is an option --include-headers to take into account .h files. I guess there could be anoption --exclude-c-files if there is enough interest to warrant the addition of yet another option.

julia

#7 lore raw
Quoted 6 lines
Quoted 2 lines

Would you like to extend use cases for your source code analysis and transformation software in this design direction?

There is an option --include-headers to take into account .h files. I guess there could be anoption --exclude-c-files if there is enough interest to warrant the addition of yet another option.

An "exclude option" does not sound promising for my feature request around including more possibilities, does it?

Regards,
Markus

#8 lore raw
Quoted 9 lines · SF Markus Elfring
Quoted 6 lines
Quoted 2 lines

Would you like to extend use cases for your source code analysis and transformation software in this design direction?

There is an option --include-headers to take into account .h files. I guess there could be anoption --exclude-c-files if there is enough interest to warrant the addition of yet another option.

An "exclude option" does not sound promising for my feature request around including more possibilities, does it?

I don't see the problem - C files are included by default, so one might perhaps want the option to exclude them.

But what else is there?

julia

#9 lore raw
Quoted 13 lines · Julia Lawall
Quoted 9 lines · SF Markus Elfring
Quoted 8 lines
Quoted 3 lines

Would you like to extend use cases for your source code analysis and transformation software in this design direction?

There is an option --include-headers to take into account .h files. I guess there could be anoption --exclude-c-files if there is enough interest to warrant the addition of yet another option.

Quoted 7 lines
Quoted 2 lines

An "exclude option" does not sound promising for my feature request around including more possibilities, does it?

I don't see the problem - C files are included by default, so one might perhaps want the option to exclude them.

But what else is there?

find -name \*.h has the same length to type and is easier to remember. That's what I use in the very few situations that I needed that feature.

bye
michael

#10 lore raw
In reply to Julia Lawall
Quoted 2 lines

I don't see the problem - C files are included by default, so one might perhaps want the option to exclude them.

Some source files can be analysed to some degree without inclusion of further header files. I like this functionality when it works as expected.

I would like to extend checks on "header files" after an analysis was finished on the primary source files.
Does it become more interesting to filter between the categories "header" and "source" data?

Quoted 1 line

But what else is there?

Header files can also contain function implementations which lead to further considerations around software designs.

Regards,
Markus

#11 lore raw
Quoted 10 lines · SF Markus Elfring
Quoted 2 lines

I don't see the problem - C files are included by default, so one might perhaps want the option to exclude them.

Some source files can be analysed to some degree without inclusion of further header files. I like this functionality when it works as expected.

I would like to extend checks on "header files" after an analysis was finished on the primary source files.
Does it become more interesting to filter between the categories "header" and "source" data?

I think that all you want is the options --no-includes --include-headers. --no-includes does not expand and #includes. --include-headers causes .h files to be processed as well as .c files. I don't see the need to control the order in which the processing is performed.

julia

#12 lore raw
Quoted 1 line

I don't see the need to control the order in which the processing is performed.

I guess that I do also not want an order change.

I suggest to select an alternative file extension filter for the source file search which is provided by your software.

Regards,
Markus

#13 lore raw
Quoted 2 lines

I suggest to select an alternative file extension filter for the source file search which is provided by your software.

I have used another simple file extension filter in my evolving source code analysis approach. Some data were imported from header files of the software "Linux next-20150123" into a database.

I guess that I can reuse them only in consistent ways if corresponding name space issues will be resolved.
How should be determined with the Coccinelle technology if the collected information is really included by a specific source file?

Regards,
Markus