Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use standard C/C++ attributes when available.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Oct 2017 20:43:41 +0000 (22:43 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Oct 2017 22:20:37 +0000 (00:20 +0200)
17 files changed:
examples/msg/process-startkilltime/process-startkilltime.c
include/simgrid/msg.h
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/Link.hpp
include/xbt/base.h
include/xbt/dict.h
include/xbt/ex.h
include/xbt/log.h
include/xbt/sysdep.h
src/surf/xml/platf.hpp
src/xbt/automaton/automaton.c
src/xbt/ex.cpp
src/xbt/mmalloc/mm_legacy.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_os_thread.c
teshsuite/smpi/mpich3-test/comm/cmsplit_type.c

index 1c69571..cb11383 100644 (file)
@@ -8,7 +8,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 /* Executed on process termination*/
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 /* Executed on process termination*/
-static int my_onexit(void* XBT_ATTRIB_UNUSED ignored1, void* XBT_ATTRIB_UNUSED ignored2)
+static int my_onexit(XBT_ATTRIB_UNUSED void* ignored1, XBT_ATTRIB_UNUSED void* ignored2)
 {
   XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */
   return 0;
 {
   XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */
   return 0;
index 8ee47ab..7aaf109 100644 (file)
@@ -169,44 +169,47 @@ XBT_PUBLIC(const char*) MSG_zone_get_property_value(msg_netzone_t as, const char
 XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
 XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.")
-    msg_netzone_t MSG_environment_get_routing_root()
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
+    MSG_environment_get_routing_root()
 {
   return MSG_zone_get_root();
 }
 {
   return MSG_zone_get_root();
 }
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.")
-    const char* MSG_environment_as_get_name(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.") static inline const
+    char* MSG_environment_as_get_name(msg_netzone_t zone)
 {
   return MSG_zone_get_name(zone);
 }
 {
   return MSG_zone_get_name(zone);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") msg_netzone_t
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
     MSG_environment_as_get_by_name(const char* name)
 {
   return MSG_zone_get_by_name(name);
 }
     MSG_environment_as_get_by_name(const char* name)
 {
   return MSG_zone_get_by_name(name);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.")
-    xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.") static inline xbt_dict_t
+    MSG_environment_as_get_routing_sons(msg_netzone_t zone)
 {
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
 {
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") const
+XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") static inline const
     char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
 {
   return MSG_zone_get_property_value(zone, name);
 }
     char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
 {
   return MSG_zone_get_property_value(zone, name);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
+XBT_ATTRIB_DEPRECATED_v319(
     "Use MSG_zone_set_property_value() instead: v3.19 will remove MSG_environment_as_set_property_value() "
     "Use MSG_zone_set_property_value() instead: v3.19 will remove MSG_environment_as_set_property_value() "
-    "completely.") void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value)
+    "completely.") static inline void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name,
+                                                                            char* value)
 {
   MSG_zone_set_property_value(zone, name, value);
 }
 {
   MSG_zone_set_property_value(zone, name, value);
 }
-static inline XBT_ATTRIB_DEPRECATED_v319(
-    "Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() completely.") xbt_dynar_t
-    MSG_environment_as_get_hosts(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() "
+                           "completely.") static inline xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t zone)
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL);
   MSG_zone_get_hosts(zone, res);
 {
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL);
   MSG_zone_get_hosts(zone, res);
@@ -262,15 +265,13 @@ XBT_PUBLIC(void) MSG_host_get_process_list(msg_host_t h, xbt_dynar_t whereto);
 XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
 
 XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
 
-static inline double
-    XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() completely.")
-        MSG_get_host_speed(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() "
+                           "completely.") static inline double MSG_get_host_speed(msg_host_t host)
 {
   return MSG_host_get_speed(host);
 }
 {
   return MSG_host_get_speed(host);
 }
-static inline double XBT_ATTRIB_DEPRECATED_v320(
-    "Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() completely.")
-    MSG_host_get_current_power_peak(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
+                           "completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
 {
   return MSG_host_get_speed(host);
 }
 {
   return MSG_host_get_speed(host);
 }
@@ -402,11 +403,10 @@ XBT_PUBLIC(msg_error_t) MSG_task_receive_bounded(msg_task_t * task, const char *
 
 XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
 XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
 
 XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
 XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
-XBT_PUBLIC(msg_comm_t)
 XBT_ATTRIB_DEPRECATED_v320(
     "This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
 XBT_ATTRIB_DEPRECATED_v320(
     "This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
-    MSG_task_isend_with_matching(msg_task_t task, const char* alias, int (*match_fun)(void*, void*, void*),
-                                 void* match_data);
+    XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char* alias,
+                                                        int (*match_fun)(void*, void*, void*), void* match_data);
 
 XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
 XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
 
 XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
 XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
index 210baad..c17b7a3 100644 (file)
@@ -307,28 +307,23 @@ XBT_PUBLIC(void) execute(double flop);
  *
  * See \ref Comm for the full communication API (including non blocking communications).
  */
  *
  * See \ref Comm for the full communication API (including non blocking communications).
  */
-XBT_PUBLIC(void*)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") recv(MailboxPtr chan);
-XBT_PUBLIC(void*)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
+    recv(MailboxPtr chan);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
     recv(MailboxPtr chan, double timeout);
     recv(MailboxPtr chan, double timeout);
-XBT_PUBLIC(CommPtr)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
     irecv(MailboxPtr chan, void** data);
 
 /** Block the actor until it delivers a message of the given simulated size to the given mailbox
  *
  * See \ref Comm for the full communication API (including non blocking communications).
 */
     irecv(MailboxPtr chan, void** data);
 
 /** Block the actor until it delivers a message of the given simulated size to the given mailbox
  *
  * See \ref Comm for the full communication API (including non blocking communications).
 */
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
-    send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
-    send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
-
-XBT_PUBLIC(CommPtr)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+    send(MailboxPtr chan, void* payload, double simulatedSize);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+    send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
+
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
     isend(MailboxPtr chan, void* payload, double simulatedSize);
 
 /** @brief Returns the actor ID of the current actor (same as pid). */
     isend(MailboxPtr chan, void* payload, double simulatedSize);
 
 /** @brief Returns the actor ID of the current actor (same as pid). */
index ff9f268..6943de3 100644 (file)
@@ -66,32 +66,32 @@ public:
   }
 
   /** Creates (but don't start) an async send to the mailbox @p dest */
   }
 
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
-      send_init(MailboxPtr dest)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+  send_init(MailboxPtr dest)
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
-      send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+  send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
-      send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") static CommPtr
+  send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.")
-      recv_init(MailboxPtr from)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.") static CommPtr
+  recv_init(MailboxPtr from)
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.")
-      recv_async(MailboxPtr from, void** data)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.") static CommPtr
+  recv_async(MailboxPtr from, void** data)
   {
     return from->get_async(data);
   }
   {
     return from->get_async(data);
   }
index 8637924..2255bc1 100644 (file)
@@ -84,7 +84,7 @@ public:
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
   static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
 
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
   static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
 
-  const char* XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") name();
+  XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") const char* name();
 };
 }
 }
 };
 }
 }
index f49a50d..8528c62 100644 (file)
      __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 #endif
 
      __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 #endif
 
+#if defined(__cplusplus)
+#if __cplusplus >= 201103L
+#define XBT_ATTRIB_NORETURN [[noreturn]]
+#endif
+#if __cplusplus >= 201703L
+#define XBT_ATTRIB_UNUSED [[maybe_unused]]
+#endif
+#if __cplusplus >= 201402L
+#define XBT_ATTRIB_DEPRECATED(msg) [[deprecated(msg)]]
+#endif
+#elif defined(__STDC_VERSION__)
+#if __STDC_VERSION__ >= 201112L
+#define XBT_ATTRIB_NORETURN _Noreturn
+#endif
+#endif
+
+#ifndef XBT_ATTRIB_NORETURN
 #define XBT_ATTRIB_NORETURN __attribute__((noreturn))
 #define XBT_ATTRIB_NORETURN __attribute__((noreturn))
+#endif
+#ifndef XBT_ATTRIB_UNUSED
 #define XBT_ATTRIB_UNUSED  __attribute__((unused))
 #define XBT_ATTRIB_UNUSED  __attribute__((unused))
-#define XBT_ATTRIB_DEPRECATED_v319(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.19 */
-#define XBT_ATTRIB_DEPRECATED_v320(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.20 */
-#define XBT_ATTRIB_DEPRECATED_v321(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.21 */
+#endif
+#ifndef XBT_ATTRIB_DEPRECATED
+#define XBT_ATTRIB_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#endif
+
+#define XBT_ATTRIB_DEPRECATED_v319(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.19 */
+#define XBT_ATTRIB_DEPRECATED_v320(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.20 */
+#define XBT_ATTRIB_DEPRECATED_v321(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.21 */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
index 8cf9fb5..9da94d6 100644 (file)
@@ -55,9 +55,8 @@ typedef struct s_xbt_dictelm {
   xbt_dictelm_t next;
 } s_xbt_dictelm_t;
 
   xbt_dictelm_t next;
 } s_xbt_dictelm_t;
 
-XBT_PUBLIC(xbt_dict_t)
 XBT_ATTRIB_DEPRECATED_v319("Use xbt_dict_new_homogeneous(). v3.19 will turn this warning into an error.")
 XBT_ATTRIB_DEPRECATED_v319("Use xbt_dict_new_homogeneous(). v3.19 will turn this warning into an error.")
-    xbt_dict_new();
+    XBT_PUBLIC(xbt_dict_t) xbt_dict_new();
 XBT_PUBLIC(xbt_dict_t) xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn);
 XBT_PUBLIC(void) xbt_dict_free(xbt_dict_t * dict);
 XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
 XBT_PUBLIC(xbt_dict_t) xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn);
 XBT_PUBLIC(void) xbt_dict_free(xbt_dict_t * dict);
 XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
@@ -75,8 +74,7 @@ XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void
 XBT_PUBLIC(void *) xbt_dict_get(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void *) xbt_dict_get_or_null(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(char*) xbt_dict_get_key(xbt_dict_t dict, const void* data);
 XBT_PUBLIC(void *) xbt_dict_get(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void *) xbt_dict_get_or_null(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(char*) xbt_dict_get_key(xbt_dict_t dict, const void* data);
-XBT_PUBLIC(char*)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(char*)
     xbt_dict_get_elm_key(xbt_dictelm_t elem);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key);
     xbt_dict_get_elm_key(xbt_dictelm_t elem);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key);
@@ -84,12 +82,10 @@ XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *
 XBT_PUBLIC(void) xbt_dict_remove(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void) xbt_dict_reset(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_length(xbt_dict_t dict);
 XBT_PUBLIC(void) xbt_dict_remove(xbt_dict_t dict, const char *key);
 XBT_PUBLIC(void) xbt_dict_reset(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_length(xbt_dict_t dict);
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
     xbt_dict_dump_output_string(void* s);
 XBT_PUBLIC(void) xbt_dict_dump(xbt_dict_t dict, void (*output) (void *));
     xbt_dict_dump_output_string(void* s);
 XBT_PUBLIC(void) xbt_dict_dump(xbt_dict_t dict, void (*output) (void *));
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
     xbt_dict_dump_sizes(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_is_empty(xbt_dict_t dict);
 
     xbt_dict_dump_sizes(xbt_dict_t dict);
 XBT_PUBLIC(int) xbt_dict_is_empty(xbt_dict_t dict);
 
@@ -148,8 +144,7 @@ XBT_PUBLIC(void) xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor);
 
 XBT_PUBLIC(char *) xbt_dict_cursor_get_key(xbt_dict_cursor_t cursor);
 XBT_PUBLIC(void *) xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor);
 
 XBT_PUBLIC(char *) xbt_dict_cursor_get_key(xbt_dict_cursor_t cursor);
 XBT_PUBLIC(void *) xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor);
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
     xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, void_f_pvoid_t free_ctn);
 
 XBT_PUBLIC(void) xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t * cursor);
     xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, void_f_pvoid_t free_ctn);
 
 XBT_PUBLIC(void) xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t * cursor);
index b475442..78ade07 100644 (file)
@@ -92,7 +92,8 @@ XBT_PUBLIC(const char *) xbt_ex_catname(xbt_errcat_t cat);
 typedef struct xbt_ex xbt_ex_t;
 
 /** Helper function used to throw exceptions in C */
 typedef struct xbt_ex xbt_ex_t;
 
 /** Helper function used to throw exceptions in C */
-XBT_PUBLIC(void) _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func) XBT_ATTRIB_NORETURN;
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void)
+    _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func);
 
 /** Builds and throws an exception
  *  @ingroup XBT_ex_c
 
 /** Builds and throws an exception
  *  @ingroup XBT_ex_c
index be33e86..7e86ff8 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -178,8 +178,8 @@ typedef enum {
 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
 #if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
-# define XBT_LOG_DEFAULT_CATEGORY(cname) \
-   static xbt_log_category_t _XBT_LOGV(default) XBT_ATTRIB_UNUSED = &_XBT_LOGV(cname)
+#define XBT_LOG_DEFAULT_CATEGORY(cname)                                                                                \
+  XBT_ATTRIB_UNUSED static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
 #endif
 
 /**
 #endif
 
 /**
index f29739e..3cbeb65 100644 (file)
@@ -31,7 +31,7 @@ SG_BEGIN_DECL()
  * @{
  */
 /** @brief Kill the program in silence */
  * @{
  */
 /** @brief Kill the program in silence */
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN xbt_abort(void);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) xbt_abort(void);
 
 /**
  * @brief Kill the program with an error message
 
 /**
  * @brief Kill the program with an error message
index bd5c32f..51b7cc3 100644 (file)
@@ -17,7 +17,7 @@ XBT_PUBLIC(void) sg_platf_exit();
 XBT_PUBLIC(void) surf_parse_open(const char *file);
 XBT_PUBLIC(void) surf_parse_close();
 XBT_PUBLIC(void) surf_parse_assert(bool cond, std::string msg);
 XBT_PUBLIC(void) surf_parse_open(const char *file);
 XBT_PUBLIC(void) surf_parse_close();
 XBT_PUBLIC(void) surf_parse_assert(bool cond, std::string msg);
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN surf_parse_error(std::string msg);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) surf_parse_error(std::string msg);
 XBT_PUBLIC(void) surf_parse_assert_netpoint(std::string hostname, std::string pre, std::string post);
 XBT_PUBLIC(void) surf_parse_warn(std::string msg);
 
 XBT_PUBLIC(void) surf_parse_assert_netpoint(std::string hostname, std::string pre, std::string post);
 XBT_PUBLIC(void) surf_parse_warn(std::string msg);
 
index 2e15eeb..dc12dbe 100644 (file)
@@ -104,7 +104,7 @@ xbt_dynar_t xbt_automaton_get_transitions(xbt_automaton_t a){
   return a->transitions;
 }
 
   return a->transitions;
 }
 
-xbt_automaton_transition_t xbt_automaton_get_transition(xbt_automaton_t XBT_ATTRIB_UNUSED a, xbt_automaton_state_t src,
+xbt_automaton_transition_t xbt_automaton_get_transition(XBT_ATTRIB_UNUSED xbt_automaton_t a, xbt_automaton_state_t src,
                                                         xbt_automaton_state_t dst)
 {
   xbt_automaton_transition_t transition;
                                                         xbt_automaton_state_t dst)
 {
   xbt_automaton_transition_t transition;
index f167d6d..e6dfd96 100644 (file)
@@ -189,7 +189,7 @@ XBT_TEST_UNIT("variables", test_variables, "variable value preservation")
 {
   xbt_ex_t ex;
   int r1;
 {
   xbt_ex_t ex;
   int r1;
-  int XBT_ATTRIB_UNUSED r2;
+  XBT_ATTRIB_UNUSED int r2;
   int v1;
   int v2;
 
   int v1;
   int v2;
 
index b02719c..5afb74a 100644 (file)
@@ -92,12 +92,12 @@ static void* mm_fake_calloc(size_t nmemb, size_t size)
   return mm_fake_malloc(n);
 }
 
   return mm_fake_malloc(n);
 }
 
-static void* mm_fake_realloc(void* XBT_ATTRIB_UNUSED p, size_t s)
+static void* mm_fake_realloc(XBT_ATTRIB_UNUSED void* p, size_t s)
 {
   return mm_fake_malloc(s);
 }
 
 {
   return mm_fake_malloc(s);
 }
 
-static void mm_fake_free(void* XBT_ATTRIB_UNUSED p)
+static void mm_fake_free(XBT_ATTRIB_UNUSED void* p)
 {
   // Nothing to do
 }
 {
   // Nothing to do
 }
@@ -119,7 +119,7 @@ static int mm_initialized;
 
 /** Constructor functions used to initialize the malloc implementation
  */
 
 /** Constructor functions used to initialize the malloc implementation
  */
-static void __attribute__((constructor(101))) mm_legacy_constructor()
+_XBT_GNUC_CONSTRUCTOR(101) static void mm_legacy_constructor()
 {
   if (mm_initialized)
     return;
 {
   if (mm_initialized)
     return;
index 57069fd..65040fa 100644 (file)
@@ -23,7 +23,7 @@ static double simple_begin_of_time = -1;
   } else                                                                \
     return 0
 
   } else                                                                \
     return 0
 
-static int xbt_log_layout_simple_doit(xbt_log_layout_t XBT_ATTRIB_UNUSED l, xbt_log_event_t ev, const char* fmt)
+static int xbt_log_layout_simple_doit(XBT_ATTRIB_UNUSED xbt_log_layout_t l, xbt_log_event_t ev, const char* fmt)
 {
   char *p = ev->buffer;
   int rem_size = ev->buffer_size;
 {
   char *p = ev->buffer;
   int rem_size = ev->buffer_size;
@@ -70,7 +70,7 @@ static int xbt_log_layout_simple_doit(xbt_log_layout_t XBT_ATTRIB_UNUSED l, xbt_
   return 1;
 }
 
   return 1;
 }
 
-xbt_log_layout_t xbt_log_layout_simple_new(char* XBT_ATTRIB_UNUSED arg)
+xbt_log_layout_t xbt_log_layout_simple_new(XBT_ATTRIB_UNUSED char* arg)
 {
   xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1);
   res->do_layout       = &xbt_log_layout_simple_doit;
 {
   xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1);
   res->do_layout       = &xbt_log_layout_simple_doit;
index 8690348..f0d9358 100644 (file)
@@ -162,7 +162,7 @@ xbt_os_thread_t xbt_os_thread_create(const char *name,  pvoid_f_pvoid_t start_ro
  *
  * If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing.
  */
  *
  * If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing.
  */
-int xbt_os_thread_bind(xbt_os_thread_t XBT_ATTRIB_UNUSED thread, int XBT_ATTRIB_UNUSED cpu)
+int xbt_os_thread_bind(XBT_ATTRIB_UNUSED xbt_os_thread_t thread, XBT_ATTRIB_UNUSED int cpu)
 {
   int errcode = 0;
 #if HAVE_PTHREAD_SETAFFINITY
 {
   int errcode = 0;
 #if HAVE_PTHREAD_SETAFFINITY
index 16681a2..c9d1d08 100644 (file)
@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
     int rank, size, verbose = 0, errs=0, tot_errs=0;
     int wrank;
     MPI_Comm comm;
     int rank, size, verbose = 0, errs=0, tot_errs=0;
     int wrank;
     MPI_Comm comm;
-    MPI_Info __attribute__((unused)) info;
+    XBT_ATTRIB_UNUSED MPI_Info info;
 
     MPI_Init(&argc, &argv);
 
 
     MPI_Init(&argc, &argv);