c++ - `Too many initializers` for for array setup in RTEMS driver definition -


background

i using rtems , trying set native nfs client. although have included correctly there not enough dynamic driver entries available driver. can seek more information here.

implementation

in order set dynamic drivers 1 needs add null elements large table of free drivers. see following:

#define null_driver_table_entry \  { null, null, null, null, null, null}   #ifdef configure_init   rtems_driver_address_table device_drivers[] = {     #ifdef configure_bsp_prerequisite_drivers       configure_bsp_prerequisite_drivers,     #endif     #ifdef configure_application_prerequisite_drivers       configure_application_prerequisite_drivers,     #endif     ...      #ifdef configure_application_extra_drivers       configure_application_extra_drivers,     #endif     #ifdef configure_application_needs_null_driver       null_driver_table_entry     #elif !defined(configure_application_needs_console_driver) && \         !defined(configure_application_needs_clock_driver) && \         !defined(configure_application_needs_rtc_driver) && \         !defined(configure_application_needs_stub_driver) && \         !defined(configure_application_needs_ide_driver) && \         !defined(configure_application_needs_ata_driver) && \         !defined(configure_application_extra_drivers)       null_driver_table_entry     #endif   }; #endif 

essentially doing building device driver table ...

a deice driver looks this:

typedef struct {   rtems_device_driver_entry initialization_entry; /* initialization procedure */   rtems_device_driver_entry open_entry;        /* open request procedure */   rtems_device_driver_entry close_entry;       /* close request procedure */   rtems_device_driver_entry read_entry;        /* read request procedure */   rtems_device_driver_entry write_entry;       /* write request procedure */   rtems_device_driver_entry control_entry;     /* special functions procedure */ }   rtems_driver_address_table; 

problem

the problem may exceptionally simple when build following error:

confdefs.h:568: error: many initializers 'rtems_driver_address_table' 

from looking here appears problem compiling unspecified number of table elements. don't understand working in if specify null_driver_table_entry 7 nulls (the number need), fail, 6 nulls works fine?

as far can tell there no definition size of table or elements? ideas?

so silly mistake...

the way table works null table entry:

#define null_driver_table_entry \  { null, null, null, null, null, null} 

is entry in array corresponds rtems_driver_address_table. driver has 6 elements , trying have 7. solution add null entry follows:

 rtems_driver_address_table device_drivers[] = {      ...      #ifdef configure_application_needs_null_driver       null_driver_table_entry,       null_driver_table_entry // add entry here!     ...    }; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -