mirror of
https://github.com/FRRouting/frr.git
synced 2025-05-01 05:57:15 +02:00
tools/gcc-plugins: fix for GCC 13
As usual, new GCC version, new small random changes in the API. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
640b59a8b0
commit
2821d3b91b
|
@ -5,11 +5,15 @@ CXX=g++-9
|
||||||
PLUGBASE=`$(CXX) -print-file-name=plugin`
|
PLUGBASE=`$(CXX) -print-file-name=plugin`
|
||||||
CPPFLAGS=-I$(PLUGBASE)/include -I$(PLUGBASE)/include/c-family
|
CPPFLAGS=-I$(PLUGBASE)/include -I$(PLUGBASE)/include/c-family
|
||||||
|
|
||||||
|
# NB: compiler flags must match those used to build gcc, otherwise inlining
|
||||||
|
# behavior is different and linker errors will result due to missing symbols
|
||||||
|
# (which should in fact be inlined)
|
||||||
|
|
||||||
frr-format.so: frr-format.o
|
frr-format.so: frr-format.o
|
||||||
$(CXX) -g -shared -o $@ $^
|
$(CXX) -fno-rtti -fno-exceptions -fasynchronous-unwind-tables -ggdb -shared -o $@ $^
|
||||||
|
|
||||||
frr-format.o: frr-format.c gcc-common.h
|
frr-format.o: frr-format.c gcc-common.h
|
||||||
$(CXX) -g $(CPPFLAGS) -fPIC -Wall -Wextra -Wno-unused-parameter -c -o $@ $<
|
$(CXX) -fno-rtti -fno-exceptions -fasynchronous-unwind-tables -ggdb $(CPPFLAGS) -fPIC -Wall -Wextra -Wno-unused-parameter -c -o $@ $<
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -d $(DESTDIR)$(PLUGBASE)
|
install -d $(DESTDIR)$(PLUGBASE)
|
||||||
|
|
|
@ -3464,7 +3464,7 @@ class frr_range_label_for_type_mismatch : public range_label
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
label_text get_text (unsigned range_idx) const OVERRIDE;
|
label_text get_text (unsigned range_idx) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
tree m_labelled_type;
|
tree m_labelled_type;
|
||||||
|
@ -3564,19 +3564,26 @@ class range_label_for_format_type_mismatch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
label_text get_text (unsigned range_idx) const FINAL OVERRIDE
|
#if BUILDING_GCC_VERSION >= 13000
|
||||||
|
#define text_get(text) text.get()
|
||||||
|
#define text_return(text, result) return label_text::take(result)
|
||||||
|
#else
|
||||||
|
#define text_get(text) text.m_buffer
|
||||||
|
#define text_return(text, result) text.maybe_free(); return label_take(result)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
label_text get_text (unsigned range_idx) const final override
|
||||||
{
|
{
|
||||||
label_text text = range_label_for_type_mismatch::get_text (range_idx);
|
label_text text = range_label_for_type_mismatch::get_text (range_idx);
|
||||||
if (text.m_buffer == NULL)
|
if (text_get(text) == NULL)
|
||||||
return text;
|
return text;
|
||||||
|
|
||||||
indirection_suffix suffix (m_pointer_count);
|
indirection_suffix suffix (m_pointer_count);
|
||||||
char *p = (char *) alloca (suffix.get_buffer_size ());
|
char *p = (char *) alloca (suffix.get_buffer_size ());
|
||||||
suffix.fill_buffer (p);
|
suffix.fill_buffer (p);
|
||||||
|
|
||||||
char *result = concat (text.m_buffer, p, NULL);
|
char *result = concat (text_get(text), p, NULL);
|
||||||
text.maybe_free ();
|
text_return(text, result);
|
||||||
return label_take(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -111,6 +111,10 @@
|
||||||
#include "varasm.h"
|
#include "varasm.h"
|
||||||
#include "stor-layout.h"
|
#include "stor-layout.h"
|
||||||
#include "internal-fn.h"
|
#include "internal-fn.h"
|
||||||
|
#if BUILDING_GCC_VERSION >= 13000
|
||||||
|
#include "gimple.h"
|
||||||
|
#include "gimple-iterator.h"
|
||||||
|
#endif
|
||||||
#include "gimple-expr.h"
|
#include "gimple-expr.h"
|
||||||
#include "gimple-fold.h"
|
#include "gimple-fold.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
|
|
Loading…
Reference in a new issue