void init(void)
{
glClearColor ((float)0.0, (float)0.0, (float)0.0, (float)0.0);
glShadeModel (GL_FLAT);
}
のパラメータglClearColor
は float です。しかし、gcc は常に警告を発します。
main.c: In function ‘init’:
main.c:12: warning: passing argument 1 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 2 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 3 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
main.c:12: warning: passing argument 4 of ‘glClearColor’ as ‘float’ rather than ‘double’ due to prototype
しかし、数字を double ではなく float に変換するだけで、理由がわかりません。
私のOSはmac os 64bitで、以下はmakefile
.
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CFLAG := -framework GLUT -framework OpenGL -g -Wall -Wconversion
else
CFLAG := -lm -lglut -lGL -lGLU -g -Wall
endif
PUB_SRC := util.c plane.c dot.c linked_dots.c controller.c time_data.c
SRC := main.c $(PUB_SRC)
TEST_SRC := test.c $(PUB_SRC)
.PHONY : main
main: $(SRC)
gcc $(CFLAG) $(SRC)
.PHONY : test
test: $(TEST_SRC)
gcc $(CFLAG) $(TEST_SRC)