[adlint-user-ja:9] Re: 同じ処理の関数の片方にだけW0609, W0612
Open source and free source code static analyzer
Brought to you by:
asamiogis
From: Yutaka Y. <ya...@us...> - 2012-10-13 20:53:43
|
矢野尾です。 ご報告ありがとうございます。 関数定義評価後にグローバル変数値に記録した副作用をロールバックする処理に 不具合がありました。 ちょうど開発チーム内でも先週同様の現象を確認しまして、明日(10/15)に対策 済みのバージョンをリリース予定です。 これはかなり重大な不具合で、ご迷惑おかけし申し訳ありません。 (2012年10月14日 05:26), 高瀬竜一 wrote: > 高瀬です. > お世話になっております. > > AdLint 2.4.6 を使用していて,おかしな警告に遭遇しました.下記のような同じ処理内容の関数が2つあり,なぜか片方の関数にだけ > W0609 と W0612 が出ます. > > W,../align.c,31,19,W0609,この論理演算の結果は常に真になります。 > W,../align.c,31,19,W0612,この if 条件式の値は常に真です。 > > 実際のコードは次の通りです. > ----------------------------------------------------- > #include<stdio.h> > #include<stdlib.h> > > extern unsigned char *main_pixbuf; > extern unsigned char *pixbuf_new(const int width, const int height); > extern void pixbuf_unref(unsigned char *ref); > extern void message_popup(void); > > void align_disp(const int width, const int height); > void align_no(const int width, const int height); > > void > align_disp(const int width, const int height) > { > if (main_pixbuf != NULL) > { > pixbuf_unref(main_pixbuf); > } > main_pixbuf = pixbuf_new(width, height); > if (main_pixbuf == NULL) > { > message_popup(); > return; /* XXX */ > } > return; > } > > void > align_no(const int width, const int height) > { > if (main_pixbuf != NULL) > { > pixbuf_unref(main_pixbuf); > } > main_pixbuf = pixbuf_new(width, height); > if (main_pixbuf == NULL) > { > message_popup(); > return; /* XXX */ > } > return; > } > ----------------------------------------------------- > 警告 W0609, W0612 が出るのは関数 align_no の方の1番目の if 文です. > > 不思議なことに無関係そうな XXX の行の return 文を消すと警告が出ないようです. > > 取り急ぎご報告まで. > -------------------------------------------------------------------- > 高瀬竜一<r-t...@ai...> > > 独立行政法人 産業技術総合研究所 > 知能システム研究部門 タスクビジョン研究グループ > -------------------------------------------------------------------- > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > adlint-user-ja mailing list > adl...@li... > https://lists.sourceforge.net/lists/listinfo/adlint-user-ja |