summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index 9d0f13ecb..f1565a089 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1677,3 +1677,13 @@ const struct frr_yang_module_info frr_interface_info = {
},
}
};
+
+#if defined(__GNUC__) && ((__GNUC__ - 0) < 5) && !defined(__clang__)
+/* gcc versions before 5.x miscalculate the size for structs with variable
+ * length arrays (they just count it as size 0)
+ *
+ * NB: the "." below means "current position", i.e. this line must be
+ * immediately after the frr_interface_info variable!
+ */
+__asm__(".size\tfrr_interface_info, .-frr_interface_info\n");
+#endif