[master] 1594037cb Add a v_* attribute for deprecated functions

Nils Goroll nils.goroll at uplex.de
Mon Apr 15 11:55:10 UTC 2019


commit 1594037cb896970c2cbfdab101d0059ac00201f9
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.

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