• English
    • Latviešu
    • Deutsch
    • русский
  • Help
  • English 
    • English
    • Latviešu
    • Deutsch
    • русский
  • Login
View Item 
  •   DSpace Home
  • B4 – LU fakultātes / Faculties of the UL
  • B --- Bij. Fizikas, matemātikas un optometrijas fakultātes studentu noslēguma darbi / Faculty of Physics, Mathematics and Optometry - Graduate works
  • Bakalaura un maģistra darbi (FMOF) / Bachelor's and Master's theses
  • View Item
  •   DSpace Home
  • B4 – LU fakultātes / Faculties of the UL
  • B --- Bij. Fizikas, matemātikas un optometrijas fakultātes studentu noslēguma darbi / Faculty of Physics, Mathematics and Optometry - Graduate works
  • Bakalaura un maģistra darbi (FMOF) / Bachelor's and Master's theses
  • View Item
JavaScript is disabled for your browser. Some features of this site may not work without it.

C un C priekšprocesora statiskā analīze

Thumbnail
View/Open
304-26881-Sinkarovs_Artjoms_DatZ030116.pdf (510.2Kb)
Author
Šinkarovs, Artjoms
Co-author
Latvijas Universitāte. Fizikas un matemātikas fakultāte
Advisor
Džonsons, Kristaps
Date
2009
Metadata
Show full item record
Abstract
Ir ļoti daudz sistēmu, kas atļauj veikt C valodas statisko analīzi. Vairākas no tām pieņem, ka pirmkods ir jāanalizē tikai pēc priekšprocesora fāzes, kur visi priekšprocesora makrosi pirmkodā ir pārvērsti par "tīru" C kodu. Šis pieņēmums var novest pie kļūdām, jo priekšprocesora fāze izmet no koda izteiksmju kopu, kura var atšķirties dažādu kompilāciju ietvaros. Šajā darbā mēs piedāvājam instrumentu, kas atļauj ģenerēt abstrakto sintaktisko koku, kur ir iekļauti gan priekšprocesora, gan C valodas priekšraksti. Darbā tiek apskatīts arī parastais pielietojums mūsu instrumentam, lai atrastu kļūdas kodā pirms priekšprocesora fāzes. Izmantojot mūsu instrumentu, ir iespējams iegūt no koda ar priekšprocesora direktīvām visu iespējamu tīru C valodu pirmkodu. Pēc tam, analizējot katru variantu ar kādu statisko C valodas analizatoru, mēs varam pierādīt, ka pirmkods ir absolūti korekts šī analizatora ietvaros.
 
There exist many well-known systems for the static analysis of C code. Unfortunately, the majority of these tools only operate after full or selective preprocessing, where preprocessor macros embedded in source files are converted into pure C-language code. The implicit assumption, that sources may be fully or partially stripped of preprocessing directives without consequence, is harmful or even outright erroneous: the preprocessing phase collapses to a set of possible macro expressions, which may differ between compilations. In this document, we introduce a tool generating the full abstract syntax tree of both preprocessor and C statements. We then consider a simple application of this tool for discovering syntactic errors in mixed C and CPP code, where the produced combinations of C and collapsed preprocessor statements are analysed by a front-end, C-only static analysis tool.
 
URI
https://dspace.lu.lv/dspace/handle/7/25647
Collections
  • Bakalaura un maģistra darbi (FMOF) / Bachelor's and Master's theses [2775]

University of Latvia
Contact Us | Send Feedback
Theme by 
@mire NV
 

 

Browse

All of DSpaceCommunities & CollectionsBy Issue DateAuthorsTitlesSubjectsThis CollectionBy Issue DateAuthorsTitlesSubjects

My Account

Login

Statistics

View Usage Statistics

University of Latvia
Contact Us | Send Feedback
Theme by 
@mire NV