diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2019-11-27 11:25:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-27 11:25:43 -0500 |
| commit | 6f84d25da4343f4426cd6a4cba91652fa512735a (patch) | |
| tree | d29708cfa0b44a4cc793b73b33878f0196d15a61 | |
| parent | 6b88cae109f767a0796bd63604f06f01706f45cc (diff) | |
| parent | 50db10a162f5929784f448152c1c0bca11dcd517 (diff) | |
Merge pull request #5435 from opensourcerouting/gcc4-vla-size
lib: add gcc 4.x workaround for frr_interface_info
| -rw-r--r-- | lib/if.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |
