C의 int64_t을 출력하니까 자꾸 경고가 떠요

조회수 4422회

발생하는 문제 및 실행환경

int64_t를 %d로 출력하니까 자꾸 경고가 떠서 더 큰 %lld로도 해봤는데 똑같습니다 ㅜㅜ lld가 제가 알고 있는 것 중에 제일 큰건데 어떻게 할까요..?

소스코드

#include <stdio.h>
#include <stdint.h>
int64_t my_int = 999999999999999999;
printf("This is my_int: %I64d\n", my_int); //이것도 경고
printf("This is my_int: %lld\n", my_int); //이것도 경고

경고 내용

warning: format ‘%I64d’ expects type ‘int’, but argument 2 has type ‘int64_t’

컴파일러 사양

~/dev/c$ cc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)