why do i get the "c++11-narrowing" warning only in switch using defines?

#define TEST0 0xFFFA0000
#define TEST1 0xFFFA0001

const int test0 = 0xFFFA0000;
const int test1 = 0xFFFA0001;

int main(int argc, char** arcv)
{
   if(argc == TEST0) // OK
   {
     return 1;
   }

   if(argc == test0) // OK
   {
     return 1;
   }

   switch(argc)
   {
     case TEST1: return 2; // ERROR: case value evaluates to 4294574081, which cannot be narrowed to type 'int' [-Wc++11-narrowing]
   }

   switch(argc)
   {
     case test1: return 2; // OK
   }
}

#define TEST0 0xFFFA0000
#define TEST1 0xFFFA0001

const int test0 = 0xFFFA0000;
const int test1 = 0xFFFA0001;

int main(int argc, char** arcv)
{
  if(argc == TEST0) // OK
  {
    return 1;
  }

  if(argc == test0) // OK
  {
    return 1;
  }

  switch(argc)
  {
    case TEST1: return 2; // ERROR: case value evaluates to 4294574081,
which cannot be narrowed to type 'int' [-Wc++11-narrowing]

The value here is unsigned, and doesn't fit in an int.

  }

  switch(argc)
  {
    case test1: return 2; // OK

The value here is signed; the conversion to int happened in the variable
declaration.

In article <55507506.9070603@gmx.net>,
    Dennis Luehring <dl.soluz@gmx.net> writes:

#define TEST0 0xFFFA0000
#define TEST1 0xFFFA0001

const int test0 = 0xFFFA0000;
const int test1 = 0xFFFA0001;

int main(int argc, char** arcv)
{
   if(argc == TEST0) // OK
   {
     return 1;
   }

   if(argc == test0) // OK
   {
     return 1;
   }

   switch(argc)
   {
     case TEST1: return 2; // ERROR: case value evaluates to 4294574081,
which cannot be narrowed to type 'int' [-Wc++11-narrowing]
   }

See section 2.14.2 Integer literals [lex.icon] in the standard. The
literal 0xFFFA0001 is too large to fit in an int (assuming int is
32-bits since you got an error about narrowing) because it extends
into the sign bit for a 32-bit integer. The largest 32-bit positive
integer is 0x7FFFFFFF. Your literal was turned into a long int as per
the above section of the standard.

This isn't really the right list for this, but...

In the `if` statements, integral promotions apply, and the resulting type
can be other than `int`. In the switch, the case labels must be converted
to match the type of the initial `switch` expression (here, `int`) -- and
the narrowing conversion from a constant is not permitted there.

-- James

i changed the defined to

((int)0xFFFA0001) etc.

that makes it more clear

thx all