[6.2] e518b5cbd Add a v_* attribute for deprecated functions

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


commit e518b5cbdb8d932506973e88a0b6c71ee4637344
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 acf94813f..2c78fa041 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -81,6 +81,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