[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debian-users:29032] warning from gcc -O -Wconversion
- From: HAYASE Shigenori <shayase@xxxxxxxxxxxxxxx>
- Subject: [debian-users:29032] warning from gcc -O -Wconversion
- Date: Sun, 1 Jul 2001 01:48:36 +0900
- X-ml-info: If you have a question, send e-mail with the body "help" (without quotes) to the address debian-users-ctl@debian.or.jp; help=<mailto:debian-users-ctl@debian.or.jp?body=help>
- X-ml-name: debian-users
- X-mlserver: fml [fml 3.0pl#17]; post only (only members can post)
- Message-id: <87ae2plxri.wl@xxxxxxxxxxxxxxxxxxxxxxx>
- X-mail-count: 29032
- User-agent: Wanderlust/2.4.1 (Stand By Me) SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (i386-debian-linux-gnu) MULE/4.0 (HANANOEN)
早瀬です。
gcc -O -Wconversion でコンパイルすると warning が出る例を二つみつけました。
これは正しい動作でしょうか? BTS でそれらしいものを発見できなかったので,
BTS に登録しようかと思ったのですが,gcc や libc6 に詳しいわけではないので,
何か勘違いなどしていないか不安。gcc3 で fix されているとか,,。
~/tmp$ dpkg -l gcc-2.95 libc6 libc6-dev
要望=(U)不明/(I)インストール/(R)削除/(P)完全削除/(H)維持
| 状態=(N)無/(I)インストール済/(C)設定/(U)展開/(F)設定失敗/(H)半インストール
|/ エラー=(空欄)無/(H)維持/(R)要再インストール/X=両方(状態,エラーの大文字=異常)
||/ 名前 バージョン 説明
+++-==============-==============-============================================
ii gcc-2.95 2.95.4-0.01042 The GNU C compiler.
ii libc6 2.2.3-5 GNU C Library: Shared libraries and Timezone
ii libc6-dev 2.2.3-5 GNU C Library: Development Libraries and Hea
== test1.c ==
#include <math.h>
int main(void)
{
exit(0);
}
== コンパイル ==
~/tmp$ gcc -O -Wconversion test1.c
In file included from /usr/include/math.h:350,
from test1.c:1:
/usr/include/bits/mathinline.h: In function `fabsf':
/usr/include/bits/mathinline.h:445: warning: passing arg 1 of `__builtin_fabsf' as `float' rather than `double' due to prototype
== test2.c ==
#include <string.h>
int main(void)
{
strcspn("01", "1");
exit(0);
}
== コンパイル ==
~/tmp$ gcc -O -Wconversion test2.c
test2.c: In function `main':
test2.c:5: warning: passing arg 2 of `__strcspn_c1' with different width due to prototype
test2.c:5: warning: passing arg 2 of `__strcspn_c2' with different width due to prototype
test2.c:5: warning: passing arg 3 of `__strcspn_c2' with different width due to prototype
test2.c:5: warning: passing arg 2 of `__strcspn_c3' with different width due to prototype
test2.c:5: warning: passing arg 3 of `__strcspn_c3' with different width due to prototype
test2.c:5: warning: passing arg 4 of `__strcspn_c3' with different width due to prototype
--
早瀬 茂規 (shayase@xxxxxxxxxxxxxxx)