enum rtdm_selecttype
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete type
So it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
Signature · 1 line
Gilles.
Quoted 11 lines · Gilles Chanteperdrix
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:
xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete typeSo it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
We can sort this out with a simple forward declaration.
Signature · 1 line
Philippe.
Quoted 8 lines · Philippe Gerum
Quoted 7 lines · Gilles Chanteperdrix
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:
xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete type
Quoted 6 lines
Quoted 4 lines
So it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
We can sort this out with a simple forward declaration.
That is the way it is done today, but gcc 4.2.1 seems not to like it. Maybe recent C standards allow the compiler to pick the smallest type for the enum as C++ does ?
Signature · 1 line
Gilles.
Quoted 14 lines · Gilles Chanteperdrix
Quoted 13 lines · Philippe Gerum
Quoted 11 lines · Gilles Chanteperdrix
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:
xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete typeSo it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
Quoted 6 lines
Quoted 1 line
We can sort this out with a simple forward declaration.
That is the way it is done today, but gcc 4.2.1 seems not to like it. Maybe recent C standards allow the compiler to pick the smallest type for the enum as C++ does ?
Or any integral type the implementation sees fit actually. Well, yes, maybe it is indeed bits of the C++ standard dripping on the C implementation of GCC, especially if forward decl of enums is not explicitly defined by the C standard.
Signature · 1 line
Philippe.
Quoted 17 lines · Philippe Gerum
Quoted 16 lines · Gilles Chanteperdrix
Quoted 14 lines · Philippe Gerum
Quoted 11 lines · Gilles Chanteperdrix
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:
xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete typeSo it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
We can sort this out with a simple forward declaration.
Quoted 8 lines
Quoted 4 lines
That is the way it is done today, but gcc 4.2.1 seems not to like it. Maybe recent C standards allow the compiler to pick the smallest type for the enum as C++ does ?
Or any integral type the implementation sees fit actually. Well, yes, maybe it is indeed bits of the C++ standard dripping on the C implementation of GCC, especially if forward decl of enums is not explicitly defined by the C standard.
Actually it is gcc 3.4 which does not like the forward decl, not gcc 4.2
Signature · 1 line
Gilles.
Quoted 23 lines · Gilles Chanteperdrix
Quoted 22 lines · Philippe Gerum
Quoted 20 lines · Gilles Chanteperdrix
Quoted 8 lines · Philippe Gerum
Quoted 7 lines · Gilles Chanteperdrix
Hi Jan,
when compiling xenomai v2.4.x for ARM with gcc 4.2.1, I get plenty of warnings like:
xenomai-arm/kernel/xenomai/skins/posix/syscall.c:38:xenomai-arm/include/xenomai/rtdm/rtdm_driver.h:206: warning: parameter has incomplete typeQuoted 6 lines
Quoted 4 lines
So it seems gcc 4.2.1 does not like the enum being used in function prototypes without being defines. So, could we move the enum definition before the functions using it ?
We can sort this out with a simple forward declaration.
That is the way it is done today, but gcc 4.2.1 seems not to like it. Maybe recent C standards allow the compiler to pick the smallest type for the enum as C++ does ?
Quoted 5 lines
Quoted 3 lines
Or any integral type the implementation sees fit actually. Well, yes, maybe it is indeed bits of the C++ standard dripping on the C implementation of GCC, especially if forward decl of enums is not explicitly defined by the C standard.
Actually it is gcc 3.4 which does not like the forward decl, not gcc 4.2
I'm fine with moving it if that helps to make all compilers happy. Just ensure that it remains in the right doxygen group.
Jan