-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Description
When compiling the code on a machine which has unsigned long defined as 8 bytes, the buggy code here will mark the second branch as duplicate branch since on x86-64 bit machines, unsigned long and unsigned long long have the same size, ie, 8 bytes.
case sizeof(unsigned long):
c = 'l';
break;
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
case sizeof(unsigned long long):
c = 'l';
flags |= FL_LONG;
flags &= ~FL_SHORT;
break;
#endifA relatively simple fix would be to have the case for unsigned long in the #else branch of the #if.
#if defined(CONFIG_HAVE_LONG_LONG) && ULLONG_MAX != ULONG_MAX
case sizeof(unsigned long long):
c = 'l';
flags |= FL_LONG;
flags &= ~FL_SHORT;
break;
#else
case sizeof(unsigned long):
c = 'l';
break;
#endifThis should fix the issue of duplicate branch.
Metadata
Metadata
Assignees
Labels
No labels