https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89380

            Bug ID: 89380
           Summary: Multiple items in brace not working on nested macro
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mdblack98 at yahoo dot com
  Target Milestone: ---

Additional report from bug#89373

#include <stdio.h>

// To see the bug
// gcc -DBUG -c x3.c

// Single item in braces is OK
// Multiple items in braces not OK

#ifdef BUG
#define MYLIST {1,2}
#else
#define MYLIST {1}
#endif

#define FRQ_RNG_160m_REGION1(md,lp,hp,v,a) \
            { 1810, 2, md, (lp), (hp), (v), (a) }

#define FRQ_RNG_HF(r,m,lp,hp,v,a) \
  FRQ_RNG_160m_REGION##r(m, (lp), (hp), (v), (a))


struct foo {
  int band;
  int region;
  int md[4];
  int lp;
  int hp;
  int v;
  int a;
};

struct foo myfoo = {  1,2, MYLIST,4,5,6,7 };

struct foo myfoo2 = FRQ_RNG_HF(1, MYLIST, 5,100,1,1);

int
main()
{
  for(int i=0;i<4;++i) printf("kk %d,%d\n",i,myfoo.md[i]);
  return 0;
}

Reply via email to