Path: sran124!katsu From: katsu@sra.co.jp (WATANABE Katsuhiro) Message-ID: Date: 4 Sep 90 13:05:29 Organization: Software Research Associates, Inc.,Japan In-reply-to: h-kasima@srasve.sra.co.jp's message of 4 Sep 90 01:52:58 GMT Newsgroups: sra.wanted Subject: Re: On warning of getpass Distribution: sra References: <128@srasve.sra.co.jp> 記事 <128@srasve.sra.co.jp> で h-kasima@srasve.sra.co.jp (Hiroshi Kashima) さんいはく > #include > char prompt[20] = {"your passwd-->"}; > main() > { > char *ptr; > > ptr = getpass(prompt); > printf("-->%s¥n",ptr); > } > > すると > "a.c", line 7: warning: illegal combination of pointer and integer, op = > といっておこられてしまいました。 getpass() の返す値の型が char * だということを、まだどこでも コンパイラーに教えてあげていないようです。ですからコンパイラーは int を返すものだと思い込んで処理をしてしまいます。 例えば #include の次の行あたりに char *getpass(); などという宣言を1行加えて、char * を返すんだよということを教えて あげてはどうでしょうか。 -- ----____----____ 渡邊克宏 ソフトウェア工学研究所(四谷)