diff options
| -rw-r--r-- | Makefile.am | 3 | ||||
| -rw-r--r-- | bgpd/bgp_vty.c | 2 | ||||
| -rw-r--r-- | doc/developer/workflow.rst | 9 | ||||
| -rw-r--r-- | lib/linklist.h | 2 | ||||
| -rw-r--r-- | lib/stream.h | 2 | ||||
| -rw-r--r-- | lib/workqueue.h | 2 | ||||
| -rw-r--r-- | lib/zclient.h | 4 | ||||
| -rw-r--r-- | ospf6d/ospf6_top.c | 4 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 4 |
9 files changed, 20 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am index 737b1acf64..30150b594b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,8 @@ include common.am AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \ -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib AM_CFLAGS = $(WERROR) -DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE) +VERSION_TYPE := $(shell if echo $(VERSION) | grep -q '^[0-9\.]*$$'; then echo RELEASE ; else echo DEV ; fi) +DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE) -DVERSION_TYPE_$(VERSION_TYPE) LIBCAP = @LIBCAP@ EXTRA_DIST = diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 14cfae0704..3e577317ad 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8865,7 +8865,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, uint8_t use_json, uptime -= p->uptime; epoch_tbuf = time(NULL) - uptime; -#if CONFDATE > 20200101 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20200101 CPP_NOTICE( "bgpTimerUp should be deprecated and can be removed now"); #endif diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index a6a950f685..291a277c6b 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -708,7 +708,14 @@ either: In all cases, compatibility pieces should be marked with compiler/preprocessor annotations to print warnings at compile time, pointing to the appropriate update path. A ``-Werror`` build should fail -if compatibility bits are used. +if compatibility bits are used. To avoid compilation issues in released +code, such compiler/preprocessor annotations must be ignored +non-development branches. For example: + + #if defined(VERSION_TYPE_DEV) && CONFDATE > 20180403 + CPP_NOTICE("Use of <XYZ> is deprecated, please use <ABC>") + #endif + Preferably, the shell script :file:`tools/fixup-deprecated.py` will be updated along with making non-backwards compatible code changes, or an diff --git a/lib/linklist.h b/lib/linklist.h index 46617b5f65..ae150158a6 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -84,7 +84,7 @@ extern void *listnode_head(struct list *); * and remove list_delete_original and the list_delete #define * Additionally remove list_free entirely */ -#if CONFDATE > 20181001 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20181001 CPP_NOTICE("list_delete without double pointer is deprecated, please fixup") #endif extern void list_delete_and_null(struct list **); diff --git a/lib/stream.h b/lib/stream.h index 8011fc0963..cc74e22a67 100644 --- a/lib/stream.h +++ b/lib/stream.h @@ -123,7 +123,7 @@ struct stream_fifo { #define STREAM_CONCAT_REMAIN(S1, S2, size) ((size) - (S1)->endp - (S2)->endp) /* deprecated macros - do not use in new code */ -#if CONFDATE > 20181128 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20181128 CPP_NOTICE("lib: time to remove deprecated stream.h macros") #endif #define STREAM_PNT(S) stream_pnt((S)) diff --git a/lib/workqueue.h b/lib/workqueue.h index fe1700f8de..6085820393 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -154,7 +154,7 @@ extern struct work_queue *work_queue_new(struct thread_master *, const char *); * The usage of work_queue_free is being transitioned to pass * in the double pointer to remove use after free's. */ -#if CONFDATE > 20190205 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20190205 CPP_NOTICE("work_queue_free without double pointer is deprecated, please fixup") #endif extern void work_queue_free_and_null(struct work_queue **); diff --git a/lib/zclient.h b/lib/zclient.h index 04f2a5c178..9d3e5c3702 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -383,7 +383,7 @@ struct zclient_options { extern struct zclient *zclient_new(struct thread_master *); /* clang-format off */ -#if CONFDATE > 20181101 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20181101 CPP_NOTICE("zclient_new_notify can take over or zclient_new now"); #endif /* clang-format on */ @@ -524,7 +524,7 @@ extern void zebra_interface_if_set_value(struct stream *, struct interface *); extern void zebra_router_id_update_read(struct stream *s, struct prefix *rid); /* clang-format off */ -#if CONFDATE > 20180823 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180823 CPP_NOTICE("zapi_ipv4_route, zapi_ipv6_route, zapi_ipv4_route_ipv6_nexthop as well as the zapi_ipv4 and zapi_ipv6 data structures should be removed now"); #endif /* clang-format on */ diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 3f1b30b9e3..e4a4891526 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -422,13 +422,13 @@ DEFUN(no_ospf6_router_id, return CMD_SUCCESS; } -#if CONFDATE > 20180828 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828 CPP_NOTICE("ospf6: `router-id A.B.C.D` deprecated 2017/08/28") #endif ALIAS_HIDDEN(ospf6_router_id, ospf6_router_id_hdn_cmd, "router-id A.B.C.D", "Configure OSPF6 Router-ID\n" V4NOTATION_STR) -#if CONFDATE > 20180828 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828 CPP_NOTICE("ospf6: `no router-id A.B.C.D` deprecated 2017/08/28") #endif ALIAS_HIDDEN(no_ospf6_router_id, no_ospf6_router_id_hdn_cmd, diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 7416079186..21567c6ce6 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -2338,7 +2338,7 @@ DEFUN (no_ospf_timers_lsa_min_arrival, return CMD_SUCCESS; } -#if CONFDATE > 20180708 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180708 CPP_NOTICE("ospf: `timers lsa arrival (0-1000)` deprecated 2017/07/08") #endif ALIAS_HIDDEN(ospf_timers_lsa_min_arrival, ospf_timers_lsa_arrival_cmd, @@ -2348,7 +2348,7 @@ ALIAS_HIDDEN(ospf_timers_lsa_min_arrival, ospf_timers_lsa_arrival_cmd, "ospf minimum arrival interval delay\n" "delay (msec) between accepted lsas\n"); -#if CONFDATE > 20180708 +#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180708 CPP_NOTICE("ospf: `no timers lsa arrival (0-1000)` deprecated 2017/07/08") #endif ALIAS_HIDDEN(no_ospf_timers_lsa_min_arrival, no_ospf_timers_lsa_arrival_cmd, |
