fork download
  1. #define ON_BOARD 1
  2.  
  3. #define PCI_VENDOR_ID_INTEL 0x8086
  4. #define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
  5.  
  6. #define DEVID_PIIXa ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0})
  7.  
  8. typedef char byte;
  9.  
  10. typedef struct ide_pci_devid_t {
  11. int one, two;
  12. } ide_pci_devid_t;
  13.  
  14. typedef struct ide_hwif_t {
  15. int whatever;
  16. } ide_hwif_t;
  17.  
  18. typedef struct ide_pci_enablebit_s {
  19. byte reg; /* byte pci reg holding the enable-bit */
  20. byte mask; /* mask to isolate the enable-bit */
  21. byte val; /* value of masked reg when "enabled" */
  22. } ide_pci_enablebit_t;
  23.  
  24. typedef struct ide_pci_device_s {
  25. ide_pci_devid_t devid;
  26. const char *name;
  27. void (*init_hwif)(ide_hwif_t *hwif);
  28. ide_pci_enablebit_t enablebits[2];
  29. byte bootable;
  30. unsigned int extra;
  31. } ide_pci_device_t;
  32.  
  33. static ide_pci_device_t ide_pci_chipsets[] = {
  34.  
  35. // HERE is where it says 'non-const initializer
  36. {DEVID_PIIXa, "PIIX", NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 },
  37.  
  38. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:36:2: error: initializer element is not constant
prog.c:36:2: error: (near initialization for ‘ide_pci_chipsets[0].devid’)
prog.c:36:25: error: ‘NULL’ undeclared here (not in a function)
prog.c:36:2: error: overflow in implicit constant conversion [-Werror=overflow]
prog.c:36:2: error: overflow in implicit constant conversion [-Werror=overflow]
prog.c:36:2: error: overflow in implicit constant conversion [-Werror=overflow]
prog.c:36:2: error: overflow in implicit constant conversion [-Werror=overflow]
prog.c:33:25: error: ‘ide_pci_chipsets’ defined but not used [-Werror=unused-variable]
cc1: all warnings being treated as errors
stdout

Standard output is empty