[6.0] fa3c8df3a Add a v_* attribute for deprecated functions

Martin Blix Grydeland martin at varnish-software.com
Tue Feb 4 10:02:07 UTC 2020


commit fa3c8df3afe8d69572265c27dd9e3a198e3506a6
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Apr 8 16:11:30 2019 +0200

    Add a v_* attribute for deprecated functions
    
    This works with gcc 6.3.0 and clang 3.8.1-24
    
    The test for __GNUC__ is deliberately simple and might not catch all
    compilers which would potentially support deprecation marks. While more
    specifics could be added, the aim is to raise awareness with developers
    and we consider it quite unlikely that anyone does not compile with one
    of the main stream compilers at all.
    
    (cherry picked from commit 1594037cb896970c2cbfdab101d0059ac00201f9)

diff --git a/include/vdef.h b/include/vdef.h
index 3a5e40329..f76407f80 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -83,6 +83,12 @@
 
 #define v_noreturn_ __attribute__((__noreturn__))
 
+#ifdef __GNUC__
+#  define v_deprecated_ __attribute__((deprecated))
+#else
+#  define v_deprecated_
+#endif
+
 /*********************************************************************
  * Pointer alignment magic
  */


More information about the varnish-commit mailing list