Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Warning: multi-character character constant

169 views
Skip to first unread message

Yang KwangWoong

unread,
Jan 15, 2002, 3:40:19 AM1/15/02
to
#include <stdio.h>

int main(void)
{
int a = '12';
printf ("%X", a);
return 0;
}

위의 소스를 컴파일 하면 아래와 같은 워닝이 나는데,
이것을 강제로 없앨 수 있는 방법이 있을까요?

a.c:5: warning: multi-character character constant


Chong-Dae Park

unread,
Jan 15, 2002, 4:32:48 AM1/15/02
to

'12'? 무슨 의미로 쓰신 건가요? unicode?

--
박종대
-- ' Clarke's Third Law
"Any sufficiently advanced technology is indistinguishable from magic."

Yang KwangWoong

unread,
Jan 15, 2002, 5:17:44 AM1/15/02
to

"Chong-Dae Park" <cdp...@jupiter.kaist.ac.kr> wrote in message
news:3c43f740$0$63515$7a21...@news.kaist.ac.kr...

> Yang KwangWoong <ygk...@semicontech.co.kr> wrote:
> > #include <stdio.h>
>
> > int main(void)
> > {
> > int a = '12';
> > printf ("%X", a);
> > return 0;
> > }
>
> > 위의 소스를 컴파일 하면 아래와 같은 워닝이 나는데,
> > 이것을 강제로 없앨 수 있는 방법이 있을까요?
>
> > a.c:5: warning: multi-character character constant
>
> '12'? 무슨 의미로 쓰신 건가요? unicode?
>

특별한 의미는 없습니다.
프로그램을 짤 때 double character를 사용하였더니 warning이
나서 예제로 만든 프로그램 입니다.

Chong-Dae Park

unread,
Jan 15, 2002, 5:30:15 AM1/15/02
to
Yang KwangWoong <ygk...@semicontech.co.kr> wrote:
>> > a.c:5: warning: multi-character character constant
>>
>> '12'? 무슨 의미로 쓰신 건가요? unicode?
>>

> 특별한 의미는 없습니다.
> 프로그램을 짤 때 double character를 사용하였더니 warning이
> 나서 예제로 만든 프로그램 입니다.

gcc의 multi-character feature를 "일부러" 사용하신 거겠죠?

-Wmultichar 옵션이 따로 있습니다. 매뉴얼을 보세요.

unicode를 사용하게 목적이라면 \uXXXX 식으로 쓰는게 어떨까요?

--
박종대
--
Roy Batty: I've seen things you people wouldn't believe. Attack ships on fire
off the shoulder of Orion. I watched C-beams glitter in the dark
near the Tannhauser gate. All those moments will be lost in time,
like tears in rain. Time to die. -- from "Blade Runner" --

0 new messages