Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » how to suppress warnings during building the c project.(how to suppress warnings during building the c project.)
how to suppress warnings during building the c project. [message #871698] Mon, 14 May 2012 17:38 Go to next message
Ramkumar Sivaraman is currently offline Ramkumar SivaramanFriend
Messages: 3
Registered: May 2012
Junior Member
Hello
I am getting this warning,
warning: multi-character character constant

I know why I am getting this error, since I am comparing an integer to a two letter string constant in single quotes,

#define CMD_ID 'ID'
int iCommand;

switch(iCommand)
{
case CMD_ID: // warning: multi-character character constant
break;
}

But I cannot modify the code to prevent as that leads to many changes. Rather I want to suppress the warning. How can I do it in eclipse IDE or inside the code? My program is in C in Linux.
Re: how to suppress warnings during building the c project. [message #871756 is a reply to message #871698] Mon, 14 May 2012 19:43 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/14/2012 11:38 AM, Ramkumar Sivaraman wrote:
> Hello
> I am getting this warning,
> warning: multi-character character constant
>
> I know why I am getting this error, since I am comparing an integer to a
> two letter string constant in single quotes,
>
> #define CMD_ID 'ID'
> int iCommand;
>
> switch(iCommand)
> { case CMD_ID: // warning: multi-character character constant
> break;
> }
>
> But I cannot modify the code to prevent as that leads to many changes.
> Rather I want to suppress the warning. How can I do it in eclipse IDE or
> inside the code? My program is in C in Linux.

As encouraged by the sticky posts at the top of this forum, please ask
C/C++ development questions in the Eclipse CDT forum.
Previous Topic:Boundle for C/C++
Next Topic:Scrapbook in Juno problem
Goto Forum:
  


Current Time: Wed Sep 25 20:18:22 GMT 2024

Powered by FUDForum. Page generated in 0.08534 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top