【发布时间】:2012-09-04 14:37:32
【问题描述】:
我是一名开始学习 C 的 Linux 用户,我正在尝试编译我输入的源代码:
#include <stdio.h>
main()
{
float c,d;
c = 10215.3;
d = c / 3;
printf("%3.2f\n",d);
return 0;
}
它使用我编写的 makefile 编译:
cc -Wall -g printf.c -o printf
但我收到此警告:
printf.c:2:1: 警告:返回类型默认为'int' [-Wreturn-type]
它编译代码并得到所需的输出,但我想了解这意味着什么
【问题讨论】:
-
第一个问题很好,在格式方面做得很好。欢迎!
标签: c compiler-warnings