diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index a25f25e4973..35228f5a511 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -418,12 +418,20 @@ using std::max; // Macro to trigger deprecation warnings #ifdef CGAL_NO_DEPRECATION_WARNINGS # define CGAL_DEPRECATED +# define CGAL_DEPRECATED_UNUSED #elif defined(__GNUC__) || __has_attribute(__deprecated__) # define CGAL_DEPRECATED __attribute__((__deprecated__)) +#if __has_attribute(__unused__) +# define CGAL_DEPRECATED_UNUSED __attribute__((__deprecated__, __unused__)) +#else +# define CGAL_DEPRECATED_UNUSED __attribute__((__deprecated__)) +#endif #elif defined (_MSC_VER) && (_MSC_VER > 1300) # define CGAL_DEPRECATED __declspec(deprecated) +# define CGAL_DEPRECATED_UNUSED __declspec(deprecated) #else # define CGAL_DEPRECATED +# define CGAL_DEPRECATED_UNUSED #endif diff --git a/Random_numbers/include/CGAL/Random.h b/Random_numbers/include/CGAL/Random.h index 7285071f569..a48da2825a7 100644 --- a/Random_numbers/include/CGAL/Random.h +++ b/Random_numbers/include/CGAL/Random.h @@ -237,7 +237,7 @@ inline Random& get_default_random() } #ifndef CGAL_NO_DEPRECATED_CODE - namespace { CGAL_DEPRECATED CGAL::Random& default_random = get_default_random(); } + namespace { CGAL_DEPRECATED_UNUSED CGAL::Random& default_random = get_default_random(); } #endif // CGAL_NO_DEPRECATED_CODE #else // CGAL_HEADER_ONLY