From: Martin Quinson Date: Thu, 17 Sep 2015 15:49:59 +0000 (+0200) Subject: s/_XBT_GNUC/XBT_ATTRIB/ as we will port them to MSVC X-Git-Tag: v3_12~186 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08b4fe22433e1835814267fcd59c52799ab5b8c1 s/_XBT_GNUC/XBT_ATTRIB/ as we will port them to MSVC --- diff --git a/doc/msg-tuto-src/masterworker0.c b/doc/msg-tuto-src/masterworker0.c index 665cba9530..3526b42d2d 100644 --- a/doc/msg-tuto-src/masterworker0.c +++ b/doc/msg-tuto-src/masterworker0.c @@ -33,7 +33,7 @@ int master(int argc, char *argv[]) int i; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -95,7 +95,7 @@ int master(int argc, char *argv[]) int worker(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; while (1) { res = MSG_task_receive(&(task),MSG_host_get_name(MSG_host_self())); xbt_assert(res == MSG_OK, "MSG_task_receive failed"); diff --git a/doc/msg-tuto-src/masterworker1.c b/doc/msg-tuto-src/masterworker1.c index f4da4004dc..2d44af85da 100644 --- a/doc/msg-tuto-src/masterworker1.c +++ b/doc/msg-tuto-src/masterworker1.c @@ -44,7 +44,7 @@ int master(int argc, char *argv[]) int i; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -110,7 +110,7 @@ int master(int argc, char *argv[]) int worker(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), diff --git a/doc/msg-tuto-src/masterworker2.c b/doc/msg-tuto-src/masterworker2.c index b8cdc8d753..4ac746910a 100644 --- a/doc/msg-tuto-src/masterworker2.c +++ b/doc/msg-tuto-src/masterworker2.c @@ -44,7 +44,7 @@ int master(int argc, char *argv[]) int i; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%lg", &timeout); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%lg", &timeout); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -107,7 +107,7 @@ int master(int argc, char *argv[]) int worker(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), diff --git a/doc/msg-tuto-src/masterworker3.c b/doc/msg-tuto-src/masterworker3.c index 85f16da3dc..75f351defd 100644 --- a/doc/msg-tuto-src/masterworker3.c +++ b/doc/msg-tuto-src/masterworker3.c @@ -46,7 +46,7 @@ int master(int argc, char *argv[]) TRACE_category(master_name); - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%lg", &timeout); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%lg", &timeout); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -110,7 +110,7 @@ int master(int argc, char *argv[]) int worker(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; char channel[1024]; build_channel_name(channel,MSG_process_get_data(MSG_process_self()), diff --git a/doc/msg-tuto-src/masterworker4.c b/doc/msg-tuto-src/masterworker4.c index 68ae6ee5ae..c50a067d31 100644 --- a/doc/msg-tuto-src/masterworker4.c +++ b/doc/msg-tuto-src/masterworker4.c @@ -46,7 +46,7 @@ int master(int argc, char *argv[]) TRACE_category(master_name); - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%lg", &timeout); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%lg", &timeout); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -136,7 +136,7 @@ int master(int argc, char *argv[]) int worker(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; char channel[1024]; const char *my_master = MSG_process_get_data(MSG_process_self()); diff --git a/examples/msg/icomms/peer.c b/examples/msg/icomms/peer.c index f35d0afa8e..1251630e19 100644 --- a/examples/msg/icomms/peer.c +++ b/examples/msg/icomms/peer.c @@ -97,7 +97,7 @@ int sender(int argc, char *argv[]) int receiver(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED msg_error_t res; + XBT_ATTRIB_UNUSED msg_error_t res; int id = -1; char mailbox[80]; msg_comm_t res_irecv; @@ -106,7 +106,7 @@ int receiver(int argc, char *argv[]) XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time, sleep_test_time); - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &id); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/examples/msg/icomms/peer2.c b/examples/msg/icomms/peer2.c index 758fae57d7..22c4affd01 100644 --- a/examples/msg/icomms/peer2.c +++ b/examples/msg/icomms/peer2.c @@ -69,11 +69,11 @@ int sender(int argc, char *argv[]) int receiver(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED msg_error_t res; + XBT_ATTRIB_UNUSED msg_error_t res; int id = -1; char mailbox[80]; msg_comm_t res_irecv; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &id); xbt_assert(read, "Invalid argument %s\n", argv[1]); MSG_process_sleep(10); diff --git a/examples/msg/icomms/peer3.c b/examples/msg/icomms/peer3.c index c3fea509c9..154fa9d64b 100644 --- a/examples/msg/icomms/peer3.c +++ b/examples/msg/icomms/peer3.c @@ -69,7 +69,7 @@ int sender(int argc, char *argv[]) sprintf(mailbox, "finalize"); msg_comm_t res_irecv; - _XBT_GNUC_UNUSED msg_error_t res_wait; + XBT_ATTRIB_UNUSED msg_error_t res_wait; for (i = 0; i < receivers_count; i++) { task = NULL; res_irecv = MSG_task_irecv(&(task), mailbox); @@ -93,7 +93,7 @@ int receiver(int argc, char *argv[]) int tasks = atof(argv[2]); msg_task_t *task = xbt_new(msg_task_t, tasks); - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &id); xbt_assert(read, "Invalid argument %s\n", argv[1]); sprintf(mailbox, "receiver-%d", id); @@ -109,7 +109,7 @@ int receiver(int argc, char *argv[]) /* Here we are waiting for the receiving of all communications */ msg_task_t task_com; while (!xbt_dynar_is_empty(comms)) { - _XBT_GNUC_UNUSED msg_error_t err; + XBT_ATTRIB_UNUSED msg_error_t err; xbt_dynar_remove_at(comms, MSG_comm_waitany(comms), &res_irecv); task_com = MSG_comm_get_task(res_irecv); MSG_comm_destroy(res_irecv); diff --git a/examples/msg/masterslave/masterslave_arg.c b/examples/msg/masterslave/masterslave_arg.c index 19b76d501e..27f1602e4b 100644 --- a/examples/msg/masterslave/masterslave_arg.c +++ b/examples/msg/masterslave/masterslave_arg.c @@ -67,7 +67,7 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; XBT_DEBUG("mailbox: %s",MSG_process_get_name(MSG_process_self())); while (1) { diff --git a/examples/msg/masterslave/masterslave_bypass.c b/examples/msg/masterslave/masterslave_bypass.c index bb5468421d..1ff3e3a1e8 100644 --- a/examples/msg/masterslave/masterslave_bypass.c +++ b/examples/msg/masterslave/masterslave_bypass.c @@ -165,7 +165,7 @@ int master(int argc, char *argv[]) double task_comp_size = 0; double task_comm_size = 0; int i; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/examples/msg/masterslave/masterslave_cluster.c b/examples/msg/masterslave/masterslave_cluster.c index 6d1bba89b0..e6bc021ff6 100644 --- a/examples/msg/masterslave/masterslave_cluster.c +++ b/examples/msg/masterslave/masterslave_cluster.c @@ -32,7 +32,7 @@ int master(int argc, char *argv[]) double task_comp_size = 0; double task_comm_size = 0; int i; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/examples/msg/masterslave/masterslave_failure.c b/examples/msg/masterslave/masterslave_failure.c index 0e9d2fb502..ce4eec9007 100644 --- a/examples/msg/masterslave/masterslave_failure.c +++ b/examples/msg/masterslave/masterslave_failure.c @@ -30,7 +30,7 @@ int master(int argc, char *argv[]) double task_comp_size = 0; double task_comm_size = 0; int i; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/examples/msg/masterslave/masterslave_forwarder.c b/examples/msg/masterslave/masterslave_forwarder.c index 7b2c01e0ac..01e1eb7242 100644 --- a/examples/msg/masterslave/masterslave_forwarder.c +++ b/examples/msg/masterslave/masterslave_forwarder.c @@ -43,7 +43,7 @@ int master(int argc, char *argv[]) int i; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -107,7 +107,7 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; while (1) { res = MSG_task_receive(&(task),MSG_host_get_name(MSG_host_self())); xbt_assert(res == MSG_OK, "MSG_task_get failed"); diff --git a/examples/msg/masterslave/masterslave_mailbox.c b/examples/msg/masterslave/masterslave_mailbox.c index 16d2efc0a8..7a5ddbbae2 100644 --- a/examples/msg/masterslave/masterslave_mailbox.c +++ b/examples/msg/masterslave/masterslave_mailbox.c @@ -65,10 +65,10 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int id = -1; char mailbox[80]; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &id); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/examples/msg/parallel_task/test_ptask.c b/examples/msg/parallel_task/test_ptask.c index 382555e8e6..1618944298 100644 --- a/examples/msg/parallel_task/test_ptask.c +++ b/examples/msg/parallel_task/test_ptask.c @@ -43,7 +43,7 @@ int execute(int argc, char *argv[]) "Unknown host %s. Stopping Now! ", argv[i]); } - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[argc - 2], "%lg", &computation_amount); xbt_assert(read, "Invalid argument %s\n", argv[argc - 2]); read = sscanf(argv[argc - 1], "%lg", &communication_amount); @@ -99,7 +99,7 @@ int redistribute(int argc, char *argv[]) "Unknown host %s. Stopping Now! ", argv[i]); } - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[argc - 1], "%lg", &communication_amount); xbt_assert(read, "Invalid argument %s\n", argv[argc - 1]); computation_duration = (double *) calloc(host_list_size, sizeof(double)); diff --git a/examples/msg/priority/priority.c b/examples/msg/priority/priority.c index bd7ad2bb62..f1efaa6861 100644 --- a/examples/msg/priority/priority.c +++ b/examples/msg/priority/priority.c @@ -28,7 +28,7 @@ static int test(int argc, char *argv[]) double priority = 1.0; msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%lg", &computation_amount); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%lg", &computation_amount); xbt_assert(res, "Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &priority); xbt_assert(res, "Invalid argument %s\n", argv[2]); diff --git a/examples/msg/properties/msg_prop.c b/examples/msg/properties/msg_prop.c index 37a2dd4f5a..c77494e0aa 100644 --- a/examples/msg/properties/msg_prop.c +++ b/examples/msg/properties/msg_prop.c @@ -99,7 +99,7 @@ int bob(int argc, char *argv[]) xbt_dict_cursor_t cursor = NULL; char *key, *data; const char *noexist = "UnknownProcessProp"; - _XBT_GNUC_UNUSED const char *value; + XBT_ATTRIB_UNUSED const char *value; XBT_INFO("== Print the properties of the process"); xbt_dict_foreach(props, cursor, key, data) diff --git a/examples/msg/token_ring/ring_call.c b/examples/msg/token_ring/ring_call.c index dbe653de93..5b7a39ddbb 100644 --- a/examples/msg/token_ring/ring_call.c +++ b/examples/msg/token_ring/ring_call.c @@ -33,7 +33,7 @@ int host(int argc, char *argv[]) int host_number = atoi(MSG_process_get_name(MSG_process_self())); char mailbox[256]; msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; if (host_number == 0){ //master send then receive sprintf(mailbox, "%d", host_number+1); task = MSG_task_create("Token", task_comp_size, task_comm_size, NULL); diff --git a/examples/msg/token_ring/token_bypass.c b/examples/msg/token_ring/token_bypass.c index c36d023ffe..99002a2ee6 100644 --- a/examples/msg/token_ring/token_bypass.c +++ b/examples/msg/token_ring/token_bypass.c @@ -30,7 +30,7 @@ int host(int argc, char *argv[]) int host_number = atoi(MSG_process_get_name(MSG_process_self())); char mailbox[256]; msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; if (host_number == 0){ //master send then receive sprintf(mailbox, "%d", host_number+1); task = MSG_task_create("Token", task_comp_size, task_comm_size, NULL); diff --git a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c index 3f704d6e7a..d5681b985d 100644 --- a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c +++ b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c @@ -113,10 +113,10 @@ int alltoall_mpi(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int id = -1; char mailbox[80]; - _XBT_GNUC_UNUSED int read; + XBT_ATTRIB_UNUSED int read; read = sscanf(argv[1], "%d", &id); xbt_assert(read, "Invalid argument %s\n", argv[1]); diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index de4fe2634f..a5b6696dbd 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -26,8 +26,8 @@ XBT_PUBLIC(void) surf_parse_close(void); XBT_PUBLIC(void) surf_parse_init_callbacks(void); XBT_PUBLIC(void) surf_parse_reset_callbacks(void); XBT_PUBLIC(void) surf_parse_free_callbacks(void); -XBT_PUBLIC(void) surf_parse_error(const char *msg,...) _XBT_GNUC_PRINTF(1,2) _XBT_GNUC_NORETURN; -XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) _XBT_GNUC_PRINTF(1,2); +XBT_PUBLIC(void) surf_parse_error(const char *msg,...) XBT_ATTRIB_PRINTF(1,2) XBT_ATTRIB_NORETURN; +XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) XBT_ATTRIB_PRINTF(1,2); XBT_PUBLIC(double) surf_parse_get_double(const char *string); XBT_PUBLIC(int) surf_parse_get_int(const char *string); XBT_PUBLIC(double) surf_parse_get_time(const char *string); diff --git a/include/xbt/base.h b/include/xbt/base.h index ae3f926f87..d9d4ac208a 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -27,23 +27,23 @@ #endif #if defined(__MINGW32__) && defined(__MINGW_PRINTF_FORMAT) - # define _XBT_GNUC_PRINTF( format_idx, arg_idx ) \ + # define XBT_ATTRIB_PRINTF( format_idx, arg_idx ) \ __attribute__((__format__ (__MINGW_PRINTF_FORMAT, format_idx, arg_idx))) #else - # define _XBT_GNUC_PRINTF( format_idx, arg_idx ) \ + # define XBT_ATTRIB_PRINTF( format_idx, arg_idx ) \ __attribute__((__format__ (__printf__, format_idx, arg_idx))) #endif #if defined(__MINGW32__) && defined(__MINGW_SCANF_FORMAT) - # define _XBT_GNUC_SCANF( format_idx, arg_idx ) \ + # define XBT_ATTRIB_SCANF( format_idx, arg_idx ) \ __attribute__((__MINGW_SCANF_FORMAT (__scanf__, format_idx, arg_idx))) #else - # define _XBT_GNUC_SCANF( format_idx, arg_idx ) \ + # define XBT_ATTRIB_SCANF( format_idx, arg_idx ) \ __attribute__((__format__ (__scanf__, format_idx, arg_idx))) #endif -# define _XBT_GNUC_NORETURN __attribute__((__noreturn__)) -# define _XBT_GNUC_UNUSED __attribute__((__unused__)) +# define XBT_ATTRIB_NORETURN __attribute__((__noreturn__)) +# define XBT_ATTRIB_UNUSED __attribute__((__unused__)) /* Constructor priorities exist since gcc 4.3. Apparently, they are however not * supported on Macs. */ @@ -57,10 +57,10 @@ # undef _XBT_NEED_INIT_PRAGMA #else /* !__GNUC__ */ -# define _XBT_GNUC_PRINTF( format_idx, arg_idx ) -# define _XBT_GNUC_SCANF( format_idx, arg_idx ) -# define _XBT_GNUC_NORETURN -# define _XBT_GNUC_UNUSED +# define XBT_ATTRIB_PRINTF( format_idx, arg_idx ) +# define XBT_ATTRIB_SCANF( format_idx, arg_idx ) +# define XBT_ATTRIB_NORETURN +# define XBT_ATTRIB_UNUSED # define _XBT_GNUC_CONSTRUCTOR(prio) # define _XBT_GNUC_DESTRUCTOR(prio) # define _XBT_NEED_INIT_PRAGMA 1 diff --git a/include/xbt/cunit.h b/include/xbt/cunit.h index 37df800cab..7a3c876b17 100644 --- a/include/xbt/cunit.h +++ b/include/xbt/cunit.h @@ -124,12 +124,12 @@ XBT_PUBLIC(void) xbt_test_exit(void); /* test operations */ XBT_PUBLIC(void) _xbt_test_add(const char *file, int line, const char *fmt, - ...) _XBT_GNUC_PRINTF(3, 4); + ...) XBT_ATTRIB_PRINTF(3, 4); XBT_PUBLIC(void) _xbt_test_fail(const char *file, int line, - const char *fmt, ...) _XBT_GNUC_PRINTF(3, + const char *fmt, ...) XBT_ATTRIB_PRINTF(3, 4); XBT_PUBLIC(void) _xbt_test_log(const char *file, int line, const char *fmt, - ...) _XBT_GNUC_PRINTF(3, 4); + ...) XBT_ATTRIB_PRINTF(3, 4); /** @brief Declare that a new test begins (printf-like parameters, describing the test) * @hideinitializer */ #define xbt_test_add(...) _xbt_test_add(__FILE__, __LINE__, __VA_ARGS__) diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 4ca03cc365..007926ec66 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -228,7 +228,7 @@ typedef struct xbt_dynar_s { } s_xbt_dynar_t; static XBT_INLINE void -_xbt_dynar_cursor_first(const xbt_dynar_t dynar _XBT_GNUC_UNUSED, +_xbt_dynar_cursor_first(const xbt_dynar_t dynar XBT_ATTRIB_UNUSED, unsigned int *const cursor) { /* iterating over a NULL dynar is a no-op (but we don't want to have uninitialized counters) */ diff --git a/include/xbt/log.h b/include/xbt/log.h index 240096d594..85f59514ad 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -348,7 +348,7 @@ XBT_PUBLIC(xbt_log_appender_t) xbt_log_appender2_file_new(char *arg,int roll); /* ********************************** */ XBT_PUBLIC(void) _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, - ...) _XBT_GNUC_PRINTF(2, 3); + ...) XBT_ATTRIB_PRINTF(2, 3); XBT_PUBLIC(int) _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority); diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 87dbc481ef..e1e454b210 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -51,7 +51,7 @@ XBT_PUBLIC_DATA(xbt_dynar_t) sg_cmdline; */ #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN) XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt, /*args */ - ...) _XBT_GNUC_PRINTF(2, 3); + ...) XBT_ATTRIB_PRINTF(2, 3); #endif /** @brief print to allocated string (reimplemented when not provided by the system) * @@ -72,7 +72,7 @@ XBT_PUBLIC(char *) bvprintf(const char *fmt, va_list ap); * Works just like asprintf(), but returns a pointer to the newly * created string, or aborts on error. */ -XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2); +XBT_PUBLIC(char *) bprintf(const char *fmt, ...) XBT_ATTRIB_PRINTF(1, 2); /** @} */ SG_END_DECL() diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index bffd706ffb..5f3caff3c1 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -35,7 +35,7 @@ SG_BEGIN_DECL() * @{ */ /** @brief Kill the program in silence */ -XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN; +XBT_PUBLIC(void) xbt_abort(void) XBT_ATTRIB_NORETURN; /** * @brief Kill the program with an error message @@ -64,10 +64,10 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt); not need to load the whole str.h and its heavy dependencies */ #ifndef __USE_GNU /* do not redeclare existing headers */ XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt, /*args */ - ...) _XBT_GNUC_PRINTF(2, 3); + ...) XBT_ATTRIB_PRINTF(2, 3); XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap); #endif -XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2); +XBT_PUBLIC(char *) bprintf(const char *fmt, ...) XBT_ATTRIB_PRINTF(1, 2); /** @addtogroup XBT_syscall * @brief Malloc and associated functions, killing the program on error (with \ref XBT_ex) diff --git a/src/bindings/java/smx_context_java.c b/src/bindings/java/smx_context_java.c index 29489d1bbf..6d7206d769 100644 --- a/src/bindings/java/smx_context_java.c +++ b/src/bindings/java/smx_context_java.c @@ -97,7 +97,7 @@ static void* smx_ctx_java_thread_run(void *data) { xbt_os_thread_set_extra_data(context); //Attach the thread to the JVM JNIEnv *env; - _XBT_GNUC_UNUSED jint error = (*__java_vm)->AttachCurrentThread(__java_vm, (void **) &env, NULL); + XBT_ATTRIB_UNUSED jint error = (*__java_vm)->AttachCurrentThread(__java_vm, (void **) &env, NULL); xbt_assert((error == JNI_OK), "The thread could not be attached to the JVM"); context->jenv = get_current_thread_env(); //Wait for the first scheduling round to happen. @@ -168,7 +168,7 @@ void smx_ctx_java_stop(smx_context_t context) /* detach the thread and kills it */ JNIEnv *env = ctx_java->jenv; (*env)->DeleteGlobalRef(env,ctx_java->jprocess); - _XBT_GNUC_UNUSED jint error = (*__java_vm)->DetachCurrentThread(__java_vm); + XBT_ATTRIB_UNUSED jint error = (*__java_vm)->DetachCurrentThread(__java_vm); xbt_assert((error == JNI_OK), "The thread couldn't be detached."); xbt_os_sem_release(((smx_ctx_java_t)context)->end); xbt_os_thread_exit(NULL); diff --git a/src/bindings/lua/lua_state_cloner.c b/src/bindings/lua/lua_state_cloner.c index 5128ec54d4..93d8271b48 100644 --- a/src/bindings/lua/lua_state_cloner.c +++ b/src/bindings/lua/lua_state_cloner.c @@ -465,7 +465,7 @@ static void sglua_copy_function(lua_State* src, lua_State* dst) { buffer.data = xbt_new(char, buffer.capacity); /* copy the binary chunk from src into a buffer */ - _XBT_GNUC_UNUSED int error = lua_dump(src, sglua_memory_writer, &buffer); + XBT_ATTRIB_UNUSED int error = lua_dump(src, sglua_memory_writer, &buffer); xbt_assert(!error, "Failed to dump the function from the source state: error %d", error); XBT_DEBUG("Fonction dumped: %zu bytes", buffer.size); diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 438ba571f7..f15d6915b6 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -333,7 +333,7 @@ static int run_lua_code(int argc, char **argv) lua_pushstring(L, argv[i]); /* call the function */ - _XBT_GNUC_UNUSED int err; + XBT_ATTRIB_UNUSED int err; err = lua_pcall(L, argc - 1, 1, 0); xbt_assert(err == 0, "Error running function `%s': %s", argv[0], lua_tostring(L, -1)); diff --git a/src/simdag/sd_daxloader.c b/src/simdag/sd_daxloader.c index 16af27ae30..5eefa8e3ec 100644 --- a/src/simdag/sd_daxloader.c +++ b/src/simdag/sd_daxloader.c @@ -381,7 +381,7 @@ xbt_dynar_t SD_daxload(const char *filename) void STag_dax__adag(void) { - _XBT_GNUC_UNUSED double version; + XBT_ATTRIB_UNUSED double version; version = dax_parse_double(A_dax__adag_version); xbt_assert(version == 2.1, diff --git a/src/simix/smx_deployment.c b/src/simix/smx_deployment.c index bb3b90b926..da7cb7444b 100644 --- a/src/simix/smx_deployment.c +++ b/src/simix/smx_deployment.c @@ -114,7 +114,7 @@ void SIMIX_init_application(void){ */ void SIMIX_launch_application(const char *file) { - _XBT_GNUC_UNUSED int parse_status; + XBT_ATTRIB_UNUSED int parse_status; xbt_assert(simix_global, "SIMIX_global_init has to be called before SIMIX_launch_application."); diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 306050c5d4..4764cb9f04 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -374,7 +374,7 @@ void surf_parse_free_callbacks(void) /* Stag and Etag parse functions */ void STag_surfxml_platform(void) { - _XBT_GNUC_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version); + XBT_ATTRIB_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version); xbt_assert((version >= 1.0), "******* BIG FAT WARNING *********\n " "You're using an ancient XML file.\n" diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index 8936daeb1c..acb25b8c2e 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -62,10 +62,10 @@ double VMHL13Model::shareResources(double now) /* 0. Make sure that we already calculated the resource share at the physical * machine layer. */ { - _XBT_GNUC_UNUSED Model *ws_model = surf_host_model; - _XBT_GNUC_UNUSED Model *vm_ws_model = surf_vm_model; - _XBT_GNUC_UNUSED unsigned int index_of_pm_ws_model = xbt_dynar_search(model_list_invoke, &ws_model); - _XBT_GNUC_UNUSED unsigned int index_of_vm_ws_model = xbt_dynar_search(model_list_invoke, &vm_ws_model); + XBT_ATTRIB_UNUSED Model *ws_model = surf_host_model; + XBT_ATTRIB_UNUSED Model *vm_ws_model = surf_vm_model; + XBT_ATTRIB_UNUSED unsigned int index_of_pm_ws_model = xbt_dynar_search(model_list_invoke, &ws_model); + XBT_ATTRIB_UNUSED unsigned int index_of_vm_ws_model = xbt_dynar_search(model_list_invoke, &vm_ws_model); xbt_assert((index_of_pm_ws_model < index_of_vm_ws_model), "Cannot assume surf_host_model comes before"); /* Another option is that we call sub_ws->share_resource() here. The @@ -260,7 +260,7 @@ VMHL13::VMHL13(VMModel *model, const char* name, xbt_dict_t props, VMHL13::~VMHL13() { /* Free the cpu_action of the VM. */ - _XBT_GNUC_UNUSED int ret = p_action->unref(); + XBT_ATTRIB_UNUSED int ret = p_action->unref(); xbt_assert(ret == 1, "Bug: some resource still remains"); } @@ -369,7 +369,7 @@ void VMHL13::migrate(surf_resource_t ind_dst_pm) new_cpu_action->setBound(old_bound); } - _XBT_GNUC_UNUSED int ret = p_action->unref(); + XBT_ATTRIB_UNUSED int ret = p_action->unref(); xbt_assert(ret == 1, "Bug: some resource still remains"); p_action = new_cpu_action; diff --git a/src/xbt/dict.c b/src/xbt/dict.c index d7e8765f38..674b7b41e7 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -824,7 +824,7 @@ static void count_check_get_key(xbt_dict_t dict, int length) { xbt_dict_cursor_t cursor; char *key; - _XBT_GNUC_UNUSED char *key2; + XBT_ATTRIB_UNUSED char *key2; void *data; int effective = 0; diff --git a/src/xbt/ex.c b/src/xbt/ex.c index 0cd35b8f6f..e6bbedb923 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -333,7 +333,7 @@ XBT_TEST_UNIT("variables", test_variables, "variable value preservation") { xbt_ex_t ex; int r1; - int _XBT_GNUC_UNUSED r2; + int XBT_ATTRIB_UNUSED r2; int v1; volatile int v2; diff --git a/src/xbt/graph.c b/src/xbt/graph.c index a0d6538cc1..1db1686e66 100644 --- a/src/xbt/graph.c +++ b/src/xbt/graph.c @@ -627,7 +627,7 @@ xbt_graph_t xbt_graph_read(const char *filename, ETag_graphxml_edge_fun = __parse_edge; xbt_graph_parse_open(filename); - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; res = xbt_graph_parse(); xbt_assert(!res, "Parse error in %s", filename); xbt_graph_parse_close(); diff --git a/src/xbt/graphxml_parse.c b/src/xbt/graphxml_parse.c index d143e32bb8..4f7605ddaf 100644 --- a/src/xbt/graphxml_parse.c +++ b/src/xbt/graphxml_parse.c @@ -123,7 +123,7 @@ int_f_void_t xbt_graph_parse = _xbt_graph_parse; double xbt_graph_parse_get_double(const char *string) { double result; - _XBT_GNUC_UNUSED int ret = 0; + XBT_ATTRIB_UNUSED int ret = 0; ret = sscanf(string, "%lg", &result); xbt_assert((ret == 1), "Parse error line %d : %s not a number", diff --git a/teshsuite/msg/host_on_off/host_on_off.c b/teshsuite/msg/host_on_off/host_on_off.c index 2c5727e940..9d6544da5b 100644 --- a/teshsuite/msg/host_on_off/host_on_off.c +++ b/teshsuite/msg/host_on_off/host_on_off.c @@ -75,7 +75,7 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int id = -1; char mailbox[80]; diff --git a/teshsuite/msg/pid/pid.c b/teshsuite/msg/pid/pid.c index f2e200a623..8542e30053 100644 --- a/teshsuite/msg/pid/pid.c +++ b/teshsuite/msg/pid/pid.c @@ -32,7 +32,7 @@ static int sendpid(int argc, char *argv[]) static int killall(int argc, char *argv[]){ msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int i; for (i=0; i<3;i++) { res = MSG_task_receive(&(task), mailbox); diff --git a/teshsuite/msg/storage/storage_basic.c b/teshsuite/msg/storage/storage_basic.c index 83046c160e..63f322dd5c 100644 --- a/teshsuite/msg/storage/storage_basic.c +++ b/teshsuite/msg/storage/storage_basic.c @@ -168,7 +168,7 @@ int client(int argc, char *argv[]) int server(int argc, char *argv[]) { msg_task_t to_execute = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; storage_info(MSG_host_self()); diff --git a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c index 048e817dbb..cc9ea1cdfe 100644 --- a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c @@ -94,7 +94,7 @@ static int worker_main(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int id = -1; char mailbox[80]; double start, end;