ç§ãã¡ãå®å®ã«äžäººã§ãããã©ããã«ã€ããŠã®è°è«ã¯ãäœå幎ãã®é人ã ã®å¿ãæ©ãŸããŠããŸããã å°çå€ææã®æ¢çŽ¢ãšãããã«æ¥è§Šããå¯èœæ§ã«åãçµãã§ããSETIãããžã§ã¯ã㯠ããã®åé¡ãšæ·±å»ãªé¢ä¿ãæã£ãŠããŸãã ãã®èšäºã§ã¯ããã®ããã°ã©ã ã®ãããžã§ã¯ãã®1ã€ïŒSETI @ homeïŒã®ãœãŒã¹ã³ãŒãã®åæã«ã€ããŠèª¬æããŸãã
ãããžã§ã¯ãã®è©³çŽ°
SETI @ homeã¯ãç§åŠè ã«ããéå¶å©ã®ãã©ã³ãã£ã¢ã³ã³ãã¥ãŒãã£ã³ã°ãããžã§ã¯ãã§ããããã©ã³ãã£ã¢ã³ã³ãã¥ãŒã¿ãŒã®ç¡æãªãœãŒã¹ã䜿çšããŠãå°çå€ææããã®ç¡ç·ä¿¡å·ãæ€çŽ¢ããŸãã ãã®ãããžã§ã¯ãã¯ãåæ£ã³ã³ãã¥ãŒãã£ã³ã°ãç·šæããããã®ãªãŒãã³ãœãããŠã§ã¢ãã©ãããã©ãŒã -C ++ã§èšè¿°ãããBOINCã«åºã¥ããŠããŸãã
åæããŒã«ãšããŠãC / C ++ã³ãŒãã®éçã¢ãã©ã€ã¶ãŒ-PVS-Studioã䜿çšããŸãã ã SETI @ homeãããžã§ã¯ãã®ãœãŒã¹ã³ãŒãã¯ãå ¬åŒWebãµã€ãã§å ¥æã§ããŸãã ãŸãããããžã§ã¯ãã®çµã¿ç«ãŠæ¹æ³ã«é¢ããæ瀺ãèŠã€ããããšãé£ãããªããããå¿ èŠãªãã®ããã¹ãŠåéããã³ãŒããŒãçšæããŠãä»äºã«åãããããŸããã
æ€èšŒçµæ
ãããžã§ã¯ããåæããåã«ãããã€ã®åé¡é åãèŠã€ããããèŠèŸŒãã§ããããšãèªããŸãã ããããé©ããããšã«ããã®å質ã«ã€ããŠèšåããæ¬åœã«èå³æ·±ãã³ãŒããã©ã°ã¡ã³ãïŒåé¡ïŒã¯ããã»ã©å€ããããŸããã§ããã
ããã«ãããããããçãããå ŽæããããŸããããããŠãç§ã¯ãããã®ããã€ããèãããã§ãã
ãŠã©ãŒã ã¢ããçš
ãã®ã»ã¯ã·ã§ã³ã®ã³ãŒãäŸã¯ãããŒããç°ãªãããããã€ã³ã¿ãŒãããã«ãŒãããªã©ã®1ã€ã®ã«ããŽãªã«å²ãåœãŠãããšã¯ã§ããŸããããç¬èªã®æ¹æ³ã§èå³æ·±ããã®ã§ãã
ãããã£ãŠãç§ã¯ãã€ã³ãã«è¿ã¥ãããšãææ¡ããŸãïŒ
struct SETI_WU_INFO : public track_mem<SETI_WU_INFO> { .... int splitter_version; .... }; SETI_WU_INFO::SETI_WU_INFO(const workunit &w):.... { .... splitter_version=(int)floor(w.group_info-> splitter_cfg->version)*0x100; splitter_version+=(int)((w.group_info->splitter_cfg->version)*0x100) && 0xff; .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V560æ¡ä»¶åŒã®äžéšã¯åžžã«çã§ãïŒ0xffã seti_header.cpp 96
æŽæ°å€ãååŸããããã«äœ¿çšãããã&&ãæŒç®åã¯çãããããã§ãã ãããããã®å ŽåãæŒç®åãïŒããå¿ èŠã§ããããã以å€ã®å Žåãå€æ°ãsplitter_versionãã¯åžžã«2ã€ã®å€ã®ãããããåãïŒ0ãŸãã¯1ã
ãã¡ããã0ãŸãã¯1ã® 'splitter_version'ã®å¢å ãæ瀺ãããå¯èœæ§ããããŸãããããã»ã©å€§ãããªãããšã«åæãããšæããŸãããã®å Žåãããç解ããããã³ãŒãïŒããšãã°ãäžé æŒç®åïŒã䜿çšã§ããŸãã
次ã®äžå¯©ãªã³ãŒãã¯ãå€ãè¿ãã¹ãã§ãããäœãè¿ããªãã¡ãœããã§ãã ããã«-圌ãã¯ç©ºã®äœãæã£ãŠããŸãã ãã®ãããªã³ãŒãã¯å°ãªããšãçãããããã«èŠããŸãã èªåã§èŠãŠã¿ãããšããå§ãããŸãã
struct float4 { .... inline float4 rsqrt() const { } inline float4 sqrt() const { } inline float4 recip() const { } .... };
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ
- V591évoidé¢æ°ã¯å€ãè¿ãå¿ èŠããããŸãã x86_float4.h 237
- V591évoidé¢æ°ã¯å€ãè¿ãå¿ èŠããããŸãã x86_float4.h 239
- V591évoidé¢æ°ã¯å€ãè¿ãå¿ èŠããããŸãã x86_float4.h 241
ãããäœã ã£ãã®ãïŒæªæ¥ãžã®å·ãŸãã¯ééã-ãã®ã³ãŒãã«ã¯ã³ã¡ã³ãããªãã£ãã®ã§ãèšãã®ã¯é£ããã§ãã äžèšã§æžããããšã«çæããŠãã ããã
ãããããã®äŸã«ãã ããã®ã§ã¯ãªããä»ã«äœãèŠã€ããããšãã§ããããèŠãŠã¿ãŸãããã
template <typename T> std::vector<T> xml_decode_field(const std::string &input, ....) { .... std::string::size_type start,endt,enc,len; .... if ((len=input.find("length=",start)!=std::string::npos)) length=atoi(&(input.c_str()[len+strlen("length=")])); .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V593 ãA = BïŒ= Cãã®åŒã®æ€èšãæ€èšããŠãã ããã åŒã¯æ¬¡ã®ããã«èšç®ãããŸãïŒ 'A =ïŒBïŒ= CïŒ'ã xml_util.h 891
ã³ãŒããããããããã«ãå ¥åããŒã¿ã®è§£æäžã«ãé·ãã®å€ïŒå€æ° 'length'ïŒãååŸããå¿ èŠããããŸããã
ã©ãããæå³ã§ããïŒ æååã¯éšåæååãlength =ããæ€çŽ¢ããèŠã€ãã£ãå Žåãéšåæååã®å é ã®ã€ã³ããã¯ã¹ãå€æ°ãlenãã«æžã蟌ãŸããŸãã ãã®åŸãå ã®æååãCæååã«å€æãããã€ã³ããã¯ã¹æŒç®åã䜿çšããŠå¿ èŠãªé·ãã®å€ãæœåºãããŸãã é·ãã®å€ãæ ŒçŽããã·ã³ãã«ã®ã€ã³ããã¯ã¹ã®èšç®ãšããŠããµãã¹ããªã³ã°ã€ã³ããã¯ã¹ãlength =ããšãã®é·ãã䜿çšãããŸãã
ãã ããæäœã®åªå é äœïŒãŸãã¯æ¡ä»¶ã«ãã©ã±ããã誀ã£ãŠé 眮ãããŠãããããããããéè€ããŠããããšã¯æããã§ãïŒããã¹ãŠããŸããããªããªããŸãã æåã«ããnposãã®å€ãšã®æ¯èŒãå®è¡ããããã®æ¯èŒã®çµæïŒ0ãŸãã¯1ïŒãå€æ°ãlenãã«æžã蟌ãŸããŸããããã«ãããé åã®ã€ã³ããã¯ã¹ãæ£ããèšç®ãããªããªããŸãã
åæãã°ãèŠãªãããããã€ãã®èå³æ·±ããã¯ãã«åºäŒããŸããã ã芧ã«ãªãããšããå§ãããŸãã
#define FORCE_FRAME_POINTER (0) #define SETIERROR( err, errmsg ) do { \ FORCE_FRAME_POINTER; \ throw seti_error( err, __FILE__, __LINE__, errmsg ); \ } while (0)
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V606ææè ãªãããŒã¯ã³ '0'ã analyzefuncs.cpp 212
ãã®ãã¯ãã¯ãã³ãŒãã®éçšã§è€æ°åééããããšãããã«èšãããã§ãã ãªãåã«äŸå€ãã¹ããŒããªãã®ãã¯äžæã§ãã 代ããã«ãã³ãŒãå ã§ç解ã§ããªãããŒã¯ã³ãçºçãã1ã€ã®å埩ã®ã¿ãå®è¡ãããã«ãŒãããããŸãã ãã®ã¢ãããŒãã¯èå³æ·±ããã®ã§ããããªããã®ãããªèªè»¢è»ãäžæãªã®ãã
ãã€ã³ã¿ãŒãšã¡ã¢ãªåŠç
å€æŽã®å Žå-ãã€ã³ã¿ãŒã䜿çšããã³ãŒãã®äŸã ååãšããŠããã€ã³ã¿ãŒãŸãã¯ã¢ãã¬ã¹ã䜿çšããäœæ¥ãå«ãã³ãŒããã©ã°ã¡ã³ãã§ã¯ãã¬ãŒããèžã確çãé çªã«å¢å ããŸãã ãããã£ãŠã圌ãã¯ããå€ãã®é¢å¿ãåŒãèµ·ãããŸãã
size_t GenChirpFftPairs(....) { .... double * ChirpSteps; .... ChirpSteps = (double *)calloc(swi.num_fft_lengths, sizeof(double)); .... CRate+=ChirpSteps[j]; .... if (ChirpSteps) free (ChirpSteps); .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ããChirpStepsããã€ã³ã¿ãŒã䜿çšãããŸããã è¡ããã§ãã¯ïŒ138ã166ãchirpfft.cpp 138
ã¢ãã©ã€ã¶ãŒã¯ããã€ã³ã¿ãŒããã«ã§ãããã©ããããã§ãã¯ããåã«ããã€ã³ã¿ãŒã䜿çšãããããšãèŠåããŸãã ã¡ã¢ãªãå²ãåœãŠãããšãã§ããã 'calloc'é¢æ°ãå€ 'NULL'ãè¿ãå Žåãnullãã€ã³ã¿ãŒã®éåç §ãå®è¡ãããŸããããã¯ããåãã®ãšãããããŸãè¯ããããŸããã
ãã1ã€ã®ãã€ã³ãã¯ããã€ã³ã¿ãŒã 'NULL'ã«çãããªãå Žåã«ã®ã¿ãé¢æ° 'free'ãåŒã³åºãããããšã§ãã ãç¡æãæ©èœã¯ãã«ãã€ã³ã¿ãŒãåé¡ãªãåŠçããããããã®ãã§ãã¯ã¯åé·ã§ãã
ãmemsetãé¢æ°ã®çããã䜿çšã䌎ãå¥ã®ã³ãŒãã èŠãŠã¿ãŸãããïŒ
int ReportTripletEvent(....) { .... static int * inv; if (!inv) inv = (int*)calloc_a(swi.analysis_cfg.triplet_pot_length, sizeof(int), MEM_ALIGN); memset(inv, -1, sizeof(inv)); for (i=0;i<swi.analysis_cfg.triplet_pot_length;i++) { j = (i*pot_len)/swi.analysis_cfg.triplet_pot_length; if (inv[j] < 0) inv[j] = i; .... } .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V579 memseté¢æ°ã¯ããã€ã³ã¿ãŒãšãã®ãµã€ãºãåŒæ°ãšããŠåãåããŸãã ééããããããŸããã 3çªç®ã®åŒæ°ã調ã¹ãŸãã analyzereport.cpp 271
ãã®ã³ãŒããã©ã°ã¡ã³ããããã¡ã¢ãªãæåã«é åã«å²ãåœãŠããããã®åŸãèŠçŽ ã«å€ã-1ããå ¥åããããããã®èŠçŽ ãåŠçãããããšãæããã§ãã ãã ããããã§ã¯ããã€ã³ã¿ãŒã®ãµã€ãºã¯3çªç®ã®ãã©ã¡ãŒã¿ãŒãšã㊠'memset'é¢æ°ã«æž¡ãããŸããã é åã«å¿ èŠãªæåãæ£ããå ¥åããã«ã¯ã3çªç®ã®åŒæ°ã«ãããã¡ãµã€ãºãæž¡ãå¿ èŠããããŸãã
ãµã€ã¯ã«
å€ãã®ãããžã§ã¯ãã«ã¯ãµã€ã¯ã«ãããããã®æ¬äœã¯ç¡éã«å®è¡ããããããŸã£ããå®è¡ãããŸããã SETI @ homeãäŸå€ã§ã¯ãããŸããã§ããã äžæ¹ãããã§ã¯ãçµæã¯ä»ã®ãããžã§ã¯ãã»ã©éèŠã§ã¯ãããŸããã
std::string hotpix::update_format() const { std::ostringstream rv(""); for (int i=2;i<2;i++) rv << "?,"; rv << "?"; return rv.str(); }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V621 ãforãæŒç®åã®æ€æ»ãæ€èšããŠãã ããã ã«ãŒãã誀ã£ãŠå®è¡ããããããŸã£ããå®è¡ãããªãå¯èœæ§ããããŸãã schema_master.cpp 9535
ééãã¯éåžžã«ç°¡åã§ãã ãåç¥ã®ããã«ããforãã«ãŒãã®æ¬äœã¯ããã®æ¡ä»¶åŒãçã§ããéãå®è¡ãããŸãã ããã§ã¯ããã§ã«æåã®å埩ã§æ¡ä»¶ãfalseã«ãªããããã«ãŒãã¯ããã«çµäºããŸãã å人çã«ã¯ãããã§äœãæå³ãããŠããã®ãç解ã§ããŸããããããã§ããã®ãµã€ã¯ã«ã®æ¬äœã¯æ±ºããŠå®è¡ãããŸããã
åæ§ã®ã³ãŒããã©ã°ã¡ã³ããåã³æ€åºãããŸããããå¥ã®ã¯ã©ã¹ã®ç°ãªãã¡ãœããã§æ€åºãããŸããã
V621 ãforãæŒç®åã®æ€æ»ãæ€èšããŠãã ããã ã«ãŒãã誀ã£ãŠå®è¡ããããããŸã£ããå®è¡ãããªãå¯èœæ§ããããŸãã schema_master.cpp 11633
ããã»ã©éæã§ã¯ãããŸããããæœåšçã«èª€ã£ãäŸïŒ
template <typename T> std::istream &operator >>(std::istream &i, sqlblob<T> &b) { .... while (!i.eof()) { i >> tmp; buf+=(tmp+' '); } .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V663ç¡éã«ãŒããå¯èœã§ãã ãcin.eofïŒïŒãæ¡ä»¶ã¯ãã«ãŒãããæããã«ã¯äžååã§ãã ãcin.failïŒïŒãé¢æ°åŒã³åºããæ¡ä»¶åŒã«è¿œå ããããšãæ€èšããŠãã ããã sqlblob.h 58
ã«ãŒããæ€èšããŠããã®ã§ããšã©ãŒããwhileãã«ãŒããçµäºããæ¡ä»¶ã«ãããšç°¡åã«æšæž¬ã§ããŸãã ããã§äœ¿çšãããæ¹æ³ã¯éåžžã«æšæºçãªãããå€ãã®äººã¯ããããçããããã®ãèŠã€ããããšã¯ãªãã§ãããã ããããèœãšãç©ŽããããŸãããããªããšããã®äŸã¯ãã®èšäºã«ã¯ãããŸããã§ããã
å®éã«ã¯ãããŒã¿èªã¿åããšã©ãŒãçºçããå Žåããã®ãããªãã§ãã¯ã§ã¯äžååã§ãã ãã®å ŽåããeofïŒïŒãã¡ãœããã¯åžžã«ãfalseããè¿ããçµæãšããŠç¡éã«ãŒãã«ãªããŸãã
ãšã©ãŒãä¿®æ£ããã«ã¯ãè¿œå ã®æ¡ä»¶ãè¿œå ããå¿ èŠããããŸãã ã«ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
while(!i.eof() && !i.fail()) { //do something }
ãã®ä»ã®äžå¯©ãªå Žæ
ãããæäœã«ã¯æ³šæããå¿ èŠããããŸãã åæäžã«ãæªå®çŸ©ã®åäœã«ã€ãªããã³ãŒãã®ã»ã¯ã·ã§ã³ã«ééããŸããã
int seti_analyze (ANALYSIS_STATE& state) { .... int last_chirp_ind = - 1 << 20, chirprateind; .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V610æªå®çŸ©ã®åäœã ã·ããæŒç®åã<<ãã確èªããŠãã ããã å·Šã®ãªãã©ã³ã '-1'ã¯è² ã§ãã analyzefuncs.cpp 177
ã³ãŒããããããããã«ãå€æ°ã¯ãããã·ããã®çµæãšããŠååŸãããå€ã§åæåãããŸãã ãããŠããã¹ãŠãããŸããããŸãããå·Šã®ãªãã©ã³ãã¯è² ã§ãããC ++ 11æšæºã«ããã°ããã®æäœã¯æªå®çŸ©ã®åäœã«ã€ãªãããŸãã
äž¡åã®å£ãåºãŠããŸãã äžæ¹ã§ã¯ãåæ§ã®ã³ãŒããé·ãéç¹°ãè¿ã䜿çšãããŠããŸããããä»æ¹ã§ã¯ããã®ã³ãŒãã¯æªå®çŸ©ã®åäœã«ã€ãªãããšããããŠããŸãã
æçµæ±ºå®ã¯ããã°ã©ã次第ã§ãããããã«æ³šæããŠãã ããã
åãå€æ°ã«ç°ãªãå€ã2åå²ãåœãŠãããã³ãŒããç¹°ãè¿ãååšãããããã®å²ãåœãŠã®éãå€æ°ã䜿çšããä»ã®æäœã¯å®è¡ãããŸããã§ããã ãã®ãããªã³ãŒãã®äžäŸïŒ
int checkpoint(BOOLEAN force_checkpoint) { int retval=0, i, l=xml_indent_level; .... retval = (int)state_file.write(str.c_str(), str.size(), 1); // ancillary data retval = state_file.printf( "<bs_score>%f</bs_score>\n" "<bs_bin>%d</bs_bin>\n" "<bs_fft_ind>%d</bs_fft_ind>\n", best_spike->score, best_spike->bin, best_spike->fft_ind); .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V519 ãretvalãå€æ°ã«ã¯ãé£ç¶ããŠ2åå€ãå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªããŠãã ããïŒ450ã452ãseti.cpp 452
ãã®ç¶æ³ã§ã¯ãäœãæ瀺ãããŠãããããŸãã¯ãããä¿®æ£ããæ¹æ³ãèšãã®ã¯å°é£ã§ãã ããããã³ãŒããæžããããã°ã©ããŒã¯ãå€æ°ã®ãã®äœ¿çšã®çç±ãç解ãããããããŸããã æšæž¬ããæšæž¬ããã ãã§ãã
ããã«4ã€ã®é¡äŒŒããã³ãŒãã»ã¯ã·ã§ã³ãäžèŽããŸããã é¢é£ããã¢ãã©ã€ã¶ãŒã¡ãã»ãŒãžïŒ
- V519 ãretvalãå€æ°ã«ã¯ãé£ç¶ããŠ2åå€ãå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªããŠãã ããïŒ470ã472ãseti.cpp 472
- V519 ãretvalãå€æ°ã«ã¯ãé£ç¶ããŠ2åå€ãå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªããŠãã ããïŒ490ã492ãseti.cpp 492
- V519 ãretvalãå€æ°ã«ã¯ãé£ç¶ããŠ2åå€ãå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªïŒ513ã515ãseti.cpp 515
- V519 ãretvalãå€æ°ã«ã¯ãé£ç¶ããŠ2åå€ãå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªããŠãã ããïŒ533ã536ãseti.cpp 536
- V519 ãlReturnValueãå€æ°ã«ã¯ãå€ãé£ç¶ããŠ2åå²ãåœãŠãããŸãã ããããããã¯ééãã§ãã è¡ã確èªïŒ85ã97ãwin_util.cpp 97
ãããã®å€æ°ã¯ãã³ãŒãããããã°ãããšãã«é¢æ°ãè¿ãå€ã衚瀺ããããã ãã«äœ¿çšãããå¯èœæ§ããããŸãã ãã®åŸãå±éºãªãã®ã¯ãªãããããã®èŠåã¯PVS-Studioã¢ãã©ã€ã¶ãŒãæäŸããå€ãã®æ¹æ³ã®1ã€ã§ç¡èŠãŸãã¯æå¶ã§ããŸãã
çµè«ãšããŠãé¢æ° 'strlen'ãããã¶ãéåççã«äœ¿çšãããäŸã瀺ããŸãã
int parse_state_file(ANALYSIS_STATE& as) { .... while(fgets(p, sizeof(buf)-(int)strlen(buf), state_file)) { if (xml_match_tag(buf, "</bt_pot_min")) break; p += strlen(p); } .... }
ã¢ãã©ã€ã¶ãŒã®èŠåïŒ V814ããã©ãŒãã³ã¹ã®äœäžã ã«ãŒãã®ç¶ç¶ã®æ¡ä»¶ãèšç®ããããšãã«ã 'strlen'é¢æ°ã®åŒã³åºããè€æ°åè¡ãããŸããã seti.cpp 770
ãããã¡ãŒïŒå€æ° 'buf'ïŒã¯ã«ãŒãã®å®è¡äžã«å€åããªããšããäºå®ã«ãããåå埩ã§ãã®é·ããèšç®ããå¿ èŠã¯ãããŸããã ããããããã®ããã«å¥ã®å€æ°ãäœæããŠãæ¯èŒãè¡ãæ¹ãé©åã§ãããã ããã¯ãå°ãããããã¡ãµã€ãºã§ã¯ããã»ã©é¡èã§ã¯ãããŸãããã倧ãããããã¡ãµã€ãºã§ã¯ãå埩åæ°ãã¯ããã«å€ãå Žåãã¯ããã«é¡èã«ãªããŸãã
ãã®ã³ãŒãã¯ç¹°ãè¿ã衚瀺ãããŠããŸãããåæ§ã®ã¡ãã»ãŒãžãããã€ããããŸãã
- V814ããã©ãŒãã³ã¹ã®äœäžã ã«ãŒãã®ç¶ç¶ã®æ¡ä»¶ãèšç®ããããšãã«ã 'strlen'é¢æ°ã®åŒã³åºããè€æ°åè¡ãããŸããã seti.cpp 784
- V814ããã©ãŒãã³ã¹ã®äœäžã 'strlen'é¢æ°ã¯ãã«ãŒãã®æ¬äœå ã§è€æ°ååŒã³åºãããŸããã xml_util.cpp 663
- V814ããã©ãŒãã³ã¹ã®äœäžã 'strlen'é¢æ°ã¯ãã«ãŒãã®æ¬äœå ã§è€æ°ååŒã³åºãããŸããã xml_util.cpp 686
ä»ã«äœãèŠã€ãããŸãããïŒ
ã¢ãã©ã€ã¶ãŒã«é¢ããä»ã®èŠåããããŸããããã³ãŒããã©ã°ã¡ã³ãã¯ãããããåå¥ã«æžãåºããŠå解ããã»ã©é¢çœããªãããšãããããŸããã ãã®ã»ã¯ã·ã§ã³ãèªãã ãã§ããã§ãã¯äžã«ä»ã«äœãèµ·ãã£ãããç¥ãããšãã§ããŸãã
ããšãã°ã宣èšãããŠããã䜿çšãããŠããªãããã³ã°ãé åããããŸããã 幞ããªããšã«ããããã®ãµã€ãºã¯åºå®ãããŠããŠå°ãããªã£ãŠããŸãã ããã«ãããããããã¹ã¿ãã¯ã¡ã¢ãªã¯ãããã«å²ãåœãŠãããŸããããããã¯éçŸå®çã§ãã
ãŸãããã€ã³ã¿ãŒã®éæ¥åç §ã¯ããã®åŸã®å¢å ïŒ* p ++ïŒãšãšãã«æ°åæ€åºãããŸããã åæã«ããã€ã³ã¿ãŒã«æ ŒçŽãããå€ã¯äœ¿çšãããŸããã§ããã äŸããããã€ã³ã¿èªäœãå€æŽããããšã ããæå³ãããŠããããšãæããã§ããããäœããã®çç±ã§éåç §ãããŸããã ãã®ã³ãŒãã¯ãããèªäœã§ã¯ãªãããã€ã³ã¿ãŒã«æ ŒçŽãããŠããå€ã®å€æŽãæå³ããå Žåããããããæœåšçã«ãšã©ãŒã§ãã ãããã£ãŠããããã®èŠåãä¿¡é Œããªãã§ãã ããã
'fprintf'é¢æ°ãç¹°ãè¿ãæ€åºãããŸãããããã®åœ¢åŒæååã¯ãé¢æ°ã«æž¡ãããå®éã®åŒæ°ã«å¯Ÿå¿ããŠããŸããã§ããã ããã«ãããæªå®çŸ©ã®åäœãçºçããããšãã°ãç»é¢ã«ãã³ã»ã³ã¹ã衚瀺ãããå ŽåããããŸãã
ãããã«
確èªããåŸãç§ã¯äºéå°è±¡ãåããŸããã äžæ¹ã§ãã³ãŒãã®ãšã©ãŒãäºæ³ãããã¯ããã«å°ãªããããèšäºã®çŽ æãå°ãªãããšã«å°ãè ¹ãç«ãŠãŸããã äžæ¹ããããžã§ã¯ãã¯ãŸã ãã¹ããããŠãããèå³æ·±ããã®ã§ããã å°æ°ã®ãšã©ãŒã¯ã³ãŒãã®å質ã瀺ããŠããããããè¯å¥œã§ãã
ä»ã«äœãè¿œå ããŸããïŒ SETI @ homeã¯ã©ã€ã¢ã³ããã€ã³ã¹ããŒã«ããŸã-å°çå€ææã®æ€çŽ¢ã«åœ¹ç«ã¡ã PVS-Studioãã€ã³ã¹ããŒã«ããŸã-C / C ++ã§æžããããœãŒã¹ã³ãŒãã®ãšã©ãŒãèŠã€ããã®ã«åœ¹ç«ã¡ãŸãã
ãã®èšäºã¯è±èªã§ãã
ãã®èšäºãè±èªåã®èŽè¡ãšå ±æãããå Žåã¯ã翻蚳ãžã®ãªã³ã¯ã䜿çšããŠãã ããïŒSergey Vasilievã å°çå€çåœãæ±ããŠãããŠãã³ãŒã³ïŒSETI @ homeã®ãœãŒã¹ã³ãŒãã®åæ
èšäºãèªãã§è³ªåããããŸããïŒ
å€ãã®å Žåãèšäºã«ã¯åã質åãå¯ããããŸãã ããã§åçãéããŸããïŒ PVS-StudioããŒãžã§ã³2015ã«é¢ããèšäºã®èªè
ããã®è³ªåãžã®åç ã ãªã¹ããã芧ãã ããã