Fix 'anonymous type with no linkage used to declare variable' in GC source
authorIvan Maidanski <ivmai@mail.ru>
Tue, 20 Feb 2018 20:03:29 +0000 (23:03 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 20 Feb 2018 20:03:29 +0000 (23:03 +0300)
Issue #206 (bdwgc).

* dyn_load.c [DARWIN] (GC_dyld_sections): Provide some name to struct.
* finalize.c (GC_fnlz_roots): Likewise.
* os_dep.c [MPROTECT_VDB && DARWIN] (GC_ports,
GC_mprotect_thread_notify, GC_mprotect_thread): Likewise.

dyn_load.c
finalize.c
os_dep.c

index 9db3186..c3cd186 100644 (file)
@@ -1247,7 +1247,7 @@ GC_INNER void GC_register_dynamic_libraries(void)
 /*#define DARWIN_DEBUG*/
 
 /* Writable sections generally available on Darwin.     */
-STATIC const struct {
+STATIC const struct dyld_sections_s {
     const char *seg;
     const char *sect;
 } GC_dyld_sections[] = {
index 5132a25..b165334 100644 (file)
@@ -71,7 +71,7 @@ struct finalizable_object {
 
 static signed_word log_fo_table_size = -1;
 
-STATIC struct {
+STATIC struct fnlz_roots_s {
   struct finalizable_object **fo_head;
   /* List of objects that should be finalized now: */
   struct finalizable_object *finalize_now;
index 6e64591..cba23c3 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -3979,7 +3979,7 @@ static struct {
   thread_state_flavor_t flavors[MAX_EXCEPTION_PORTS];
 } GC_old_exc_ports;
 
-STATIC struct {
+STATIC struct ports_s {
   void (*volatile os_callback[3])(void);
   mach_port_t exception;
 # if defined(THREADS)
@@ -4022,7 +4022,7 @@ typedef enum {
   /* The following should ONLY be called when the world is stopped.     */
   STATIC void GC_mprotect_thread_notify(mach_msg_id_t id)
   {
-    struct {
+    struct buf_s {
       GC_msg_t msg;
       mach_msg_trailer_t trailer;
     } buf;
@@ -4088,11 +4088,11 @@ STATIC void *GC_mprotect_thread(void *arg)
   /* These two structures contain some private kernel data.  We don't   */
   /* need to access any of it so we don't bother defining a proper      */
   /* struct.  The correct definitions are in the xnu source code.       */
-  struct {
+  struct reply_s {
     mach_msg_header_t head;
     char data[256];
   } reply;
-  struct {
+  struct msg_s {
     mach_msg_header_t head;
     mach_msg_body_t msgh_body;
     char data[1024];