[openib-general] [libibcm] compilation of code that uses libibcm may fail

Dotan Barak dotanb at mellanox.co.il
Sun Aug 6 05:44:11 PDT 2006


Hi.

I compiled code of a test that we wrote and i get compilaton error, here is the compilation error:

cc -c -g -O2 -Wall -W -Werror -I/usr/mst/include -I/usr/local/include/infiniband async_event_test.c
In file included from /usr/include/vl_gen2u_str.h:40,
                 from /usr/include/vl.h:49,
                 from async_event_test.c:38:
/usr/local/include/infiniband/cm.h:209: error: syntax error before numeric constant
make: *** [async_event_test.o] Error 1


when i looked at a preprocessed code of the test i noticed the following code:

enum ib_cm_sidr_status {
 0,
 1,
 2,
 3,
 4,
 IB_SIDR_UNSUPPORTED_VERSION
};

it seems that the enumerations values were replaced with integers.

when i searched for the values that were enumerated in the headre files i found the following defines in ib_types.h:

#define IB_SIDR_SUCCESS                                         0
#define IB_SIDR_UNSUPPORTED                                     1
#define IB_SIDR_REJECT                                          2
#define IB_SIDR_NO_QP                                           3
#define IB_SIDR_REDIRECT                                        4


I think that the problem was that ib_types.h was included in a file that includes the cm.h and the preprocessor replaced the
enumeration names with the integer values.

who can check this issue?

thanks
Dotan




More information about the general mailing list