From: Daniel Arndt Date: Sun, 29 Jul 2018 23:32:43 +0000 (+0200) Subject: Improve deprecation messages X-Git-Tag: v9.1.0-rc1~866^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f3996b1eaee17f0d83e6982a952da61fb3a5643;p=dealii.git Improve deprecation messages --- diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 3ab70dad51..14d4a0c61f 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -389,9 +389,15 @@ _Pragma("GCC diagnostic pop") * http://goodliffe.blogspot.com/2009/07/c-how-to-say-warning-to-visual-studio-c.html */ -#define DEAL_II_STRINGIZE_HELPER(x) #x -#define DEAL_II_STRINGIZE(x) DEAL_II_STRINGIZE_HELPER(x) -#define DEAL_II_WARNING(desc) message(__FILE__ "(" DEAL_II_STRINGIZE(__LINE__) ") : Warning: " #desc) +#ifdef _MSC_VER + #define DEAL_II_STRINGIZE_HELPER(x) #x + #define DEAL_II_STRINGIZE(x) DEAL_II_STRINGIZE_HELPER(x) + #define DEAL_II_DO_PRAGMA(x) __pragma(x) + #define DEAL_II_WARNING(desc) DEAL_II_DO_PRAGMA(message(__FILE__ "(" DEAL_II_STRINGIZE(__LINE__) ") : warning: " #desc)) +#else + #define DEAL_II_DO_PRAGMA(x) _Pragma(#x) + #define DEAL_II_WARNING(desc) DEAL_II_DO_PRAGMA(message(#desc)) +#endif /*********************************************************************** * Final inclusions: diff --git a/include/deal.II/base/sacado_product_type.h b/include/deal.II/base/sacado_product_type.h index 450b396843..696ded0574 100644 --- a/include/deal.II/base/sacado_product_type.h +++ b/include/deal.II/base/sacado_product_type.h @@ -3,8 +3,7 @@ #include -#pragma DEAL_II_WARNING( \ - "This file is deprecated. Use instead.") +DEAL_II_WARNING(`"This file is deprecated. Use instead.") #include diff --git a/include/deal.II/dofs/function_map.h b/include/deal.II/dofs/function_map.h index 2e00e3fccd..b263aafad7 100644 --- a/include/deal.II/dofs/function_map.h +++ b/include/deal.II/dofs/function_map.h @@ -20,6 +20,6 @@ #include -#pragma DEAL_II_WARNING("This file is deprecated.") +DEAL_II_WARNING("This file is deprecated.") #endif diff --git a/include/deal.II/grid/tria_boundary.h b/include/deal.II/grid/tria_boundary.h index 36f1dd64b0..2571178f4b 100644 --- a/include/deal.II/grid/tria_boundary.h +++ b/include/deal.II/grid/tria_boundary.h @@ -18,7 +18,6 @@ #include -#pragma DEAL_II_WARNING( \ - "This file is deprecated. Use the Manifold classes instead.") +DEAL_II_WARNING("This file is deprecated. Use the Manifold classes instead.") #endif diff --git a/include/deal.II/grid/tria_boundary_lib.h b/include/deal.II/grid/tria_boundary_lib.h index 8832284b2a..fed6712823 100644 --- a/include/deal.II/grid/tria_boundary_lib.h +++ b/include/deal.II/grid/tria_boundary_lib.h @@ -18,7 +18,6 @@ #include -#pragma DEAL_II_WARNING( \ - "This file is deprecated.Use the Manifold classes instead.") +DEAL_II_WARNING("This file is deprecated.Use the Manifold classes instead.") #endif diff --git a/include/deal.II/lac/constraint_matrix.h b/include/deal.II/lac/constraint_matrix.h index 28d95d106f..f7a5dfa9a3 100644 --- a/include/deal.II/lac/constraint_matrix.h +++ b/include/deal.II/lac/constraint_matrix.h @@ -19,7 +19,7 @@ #include -#pragma DEAL_II_WARNING( \ +DEAL_II_WARNING( "This file is deprecated. Use instead.") #include diff --git a/include/deal.II/lac/parallel_block_vector.h b/include/deal.II/lac/parallel_block_vector.h index 22e7e9151b..2bbda29393 100644 --- a/include/deal.II/lac/parallel_block_vector.h +++ b/include/deal.II/lac/parallel_block_vector.h @@ -20,7 +20,7 @@ #include -#pragma DEAL_II_WARNING( \ +DEAL_II_WARNING( "This file is deprecated. Use and LinearAlgebra::distributed::BlockVector instead.") #include diff --git a/include/deal.II/lac/parallel_vector.h b/include/deal.II/lac/parallel_vector.h index dbfce5cbe0..d21b59f011 100644 --- a/include/deal.II/lac/parallel_vector.h +++ b/include/deal.II/lac/parallel_vector.h @@ -20,7 +20,7 @@ #include -#pragma DEAL_II_WARNING( \ +DEAL_II_WARNING( "This file is deprecated. Use and LinearAlgebra::distributed::Vector instead.") #include diff --git a/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h b/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h index 617a95a859..3443d5d333 100644 --- a/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h +++ b/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h @@ -21,7 +21,7 @@ #include -#pragma DEAL_II_WARNING( \ +DEAL_II_WARNING( "This file is deprecated. Use deal.II/lac/petsc_block_sparse_matrix.h instead!") #endif // dealii_petsc_parallel_block_sparse_matrix_h diff --git a/include/deal.II/lac/petsc_parallel_block_vector.h b/include/deal.II/lac/petsc_parallel_block_vector.h index 5a3ff99e34..c6a9844c4c 100644 --- a/include/deal.II/lac/petsc_parallel_block_vector.h +++ b/include/deal.II/lac/petsc_parallel_block_vector.h @@ -21,7 +21,7 @@ #include -#pragma DEAL_II_WARNING( \ +DEAL_II_WARNING( "This file is deprecated. Use deal.II/lac/petsc_block_vector.h instead!") #endif diff --git a/include/deal.II/lac/petsc_parallel_sparse_matrix.h b/include/deal.II/lac/petsc_parallel_sparse_matrix.h index 559d6c385c..0b203b3f3c 100644 --- a/include/deal.II/lac/petsc_parallel_sparse_matrix.h +++ b/include/deal.II/lac/petsc_parallel_sparse_matrix.h @@ -20,8 +20,8 @@ # include -# pragma DEAL_II_WARNING( \ - "This file is deprecated. Use deal.II/lac/petsc_sparse_matrix.h instead.") +DEAL_II_WARNING( + "This file is deprecated. Use deal.II/lac/petsc_sparse_matrix.h instead.") #endif /*---------------------- petsc_parallel_sparse_matrix.h ---------------------*/ diff --git a/include/deal.II/lac/petsc_parallel_vector.h b/include/deal.II/lac/petsc_parallel_vector.h index a238651932..2c75995cda 100644 --- a/include/deal.II/lac/petsc_parallel_vector.h +++ b/include/deal.II/lac/petsc_parallel_vector.h @@ -20,8 +20,8 @@ # include -# pragma DEAL_II_WARNING( \ - "This file is deprecated. Use deal.II/lac/petsc_vector.h instead!") +DEAL_II_WARNING( + "This file is deprecated. Use deal.II/lac/petsc_vector.h instead!") #endif /*------------------------- petsc_parallel_vector.h -------------------------*/ diff --git a/source/base/timer.cc b/source/base/timer.cc index 710abf4b03..007f9dd017 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -127,7 +127,7 @@ CPUClock::now() noexcept getrusage(RUSAGE_SELF, &usage); system_cpu_duration = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec; #else -# pragma DEAL_II_WARNING("Unsupported platform. Porting not finished.") + DEAL_II_WARNING("Unsupported platform. Porting not finished.") #endif return time_point( internal::TimerImplementation::from_seconds(system_cpu_duration));