]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: work around gcc bug #69981
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 16 Aug 2016 15:48:44 +0000 (17:48 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 19 Sep 2016 20:31:08 +0000 (16:31 -0400)
The memtypes changes break gcc -O0 build (none of the other optimisation
levels are affected, *any* of -Og, -Os, -O1, etc. make this go away).
Unfortunately, the option supposed to control this doesn't actually work
(-fno-keep-static-const; that not working is the actual gcc bug).

The workaround is to avoid DECLARE_MTYPE statements when their paired
DEFINE_MTYPE isn't linked in.  Thankfully, that's only a problem in a
single place in vtysh where bgp_memory.h gets chain-included.
(vtysh.c -> bgp_vty.h -> bgpd.h -> bgp_memory.h)

So, this just breaks the chain at bgp_vty.h.

No other compiler (clang & icc tested) has exhibited this problem.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_vty.h

index ba520af06794eb9b2c658d9c1d7385b969573988..573e8c707213be387be4e977d9557e9193d62208 100644 (file)
@@ -21,7 +21,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #ifndef _QUAGGA_BGP_VTY_H
 #define _QUAGGA_BGP_VTY_H
 
-#include "bgpd/bgpd.h"
+struct bgp;
 
 #define CMD_AS_RANGE "<1-4294967295>"
 #define DYNAMIC_NEIGHBOR_LIMIT_RANGE "<1-5000>"