title: Preprocessor initialized struct
body: <p>I have a large amount of constant data that I need to store in a header file. Due to the nature of the data (how its nested), I decided to use a structure that is initialized by the preprocessor.</p>
  
  <p>I am trying to initialize these structs like so:</p>
  
  <pre><code>typedef struct s_PWM {
    uint8_t muxmode;
    char *name;
    char *path;
  } PWM;
  
  typedef struct s_PIN {
    char *name;
    uint8_t gpio;
    char *mux;
    uint8_t eeprom;
    PWM *pwm;
  } PIN;
  </code></pre>
  
  <p>This would allow me to do something like </p>
  
  <pre><code>PIN p1 = P8_19;
  </code></pre>
  
  <p>to, in a sense, assemble a struct with the proper attributes. </p>
  
  <p>Basically, you can send a pin into a function </p>
  
  <pre><code>pinMode(P8_19, OUTPUT)
  </code></pre>
  
  <p>This is the line in question</p>
  
  <pre><code>#define P8_19 ((PIN){"EHRPWM2A", 22, "gpmc_ad8", 14, (PWM*){4, "EHRPWM2A", "ehrpwm.2:0"}})
  </code></pre>
  
  <p>This is the warning</p>
  
  <pre><code>src/gpio.c:50:2: warning: excess elements in scalar initializer
  src/gpio.c:50:2: warning: (near initialization for '(anonymous)')
  src/gpio.c:50:2: warning: excess elements in scalar initializer
  src/gpio.c:50:2: warning: (near initialization for '(anonymous)')
  </code></pre>
  
  <p>Does anyone have any ideas why this is happening? Am I incorrectly nesting the PWM* struct into the PIN struct?</p>