diff --git a/stan/math/opencl/kernels/add.hpp b/stan/math/opencl/kernels/add.hpp
index e37e2b21cdc..81f4c94f440 100644
--- a/stan/math/opencl/kernels/add.hpp
+++ b/stan/math/opencl/kernels/add.hpp
@@ -12,7 +12,7 @@ namespace math {
namespace opencl_kernels {
// \cond
-static constexpr const char *add_batch_kernel_code = STRINGIFY(
+static constexpr const char* add_batch_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Sums a batch of matrices. Buffer A contains
diff --git a/stan/math/opencl/kernels/check_symmetric.hpp b/stan/math/opencl/kernels/check_symmetric.hpp
index 81efa9f5d9c..5a2cf62e666 100644
--- a/stan/math/opencl/kernels/check_symmetric.hpp
+++ b/stan/math/opencl/kernels/check_symmetric.hpp
@@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
-static constexpr const char *is_symmetric_kernel_code = STRINGIFY(
+static constexpr const char* is_symmetric_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Check if the matrix_cl
is symmetric
diff --git a/stan/math/opencl/kernels/cumulative_sum.hpp b/stan/math/opencl/kernels/cumulative_sum.hpp
index 12e5d94ca97..c05b819441a 100644
--- a/stan/math/opencl/kernels/cumulative_sum.hpp
+++ b/stan/math/opencl/kernels/cumulative_sum.hpp
@@ -12,7 +12,7 @@ namespace math {
namespace opencl_kernels {
// \cond
-static constexpr const char *cumulative_sum1_kernel_code = STRINGIFY(
+static constexpr const char* cumulative_sum1_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* First kernel of the cumulative sum implementation. Each thread sums the
@@ -62,7 +62,7 @@ static constexpr const char *cumulative_sum1_kernel_code = STRINGIFY(
// \endcond
// \cond
-static constexpr const char *cumulative_sum2_kernel_code = STRINGIFY(
+static constexpr const char* cumulative_sum2_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Second kernel of the cumulative sum implementation. Calculates prefix sum
@@ -116,7 +116,7 @@ static constexpr const char *cumulative_sum2_kernel_code = STRINGIFY(
// \endcond
// \cond
-static constexpr const char *cumulative_sum3_kernel_code = STRINGIFY(
+static constexpr const char* cumulative_sum3_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Third kernel of the cumulative sum implementation. Given sums of threads
diff --git a/stan/math/opencl/kernels/device_functions/atomic_add_double.hpp b/stan/math/opencl/kernels/device_functions/atomic_add_double.hpp
index b07e1246d24..221ce4c546b 100644
--- a/stan/math/opencl/kernels/device_functions/atomic_add_double.hpp
+++ b/stan/math/opencl/kernels/device_functions/atomic_add_double.hpp
@@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
-static constexpr const char *atomic_add_double_device_function
+static constexpr const char* atomic_add_double_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
diff --git a/stan/math/opencl/kernels/divide_columns.hpp b/stan/math/opencl/kernels/divide_columns.hpp
index 9bad330ebaa..95f006c53d4 100644
--- a/stan/math/opencl/kernels/divide_columns.hpp
+++ b/stan/math/opencl/kernels/divide_columns.hpp
@@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
-static constexpr const char *divide_columns_kernel_code = STRINGIFY(
+static constexpr const char* divide_columns_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Takes vector A and divides columns vector in A element-wise by the values
diff --git a/stan/math/prim/prob/beta_binomial_rng.hpp b/stan/math/prim/prob/beta_binomial_rng.hpp
index a96ecfd5c3c..7445ae2d269 100644
--- a/stan/math/prim/prob/beta_binomial_rng.hpp
+++ b/stan/math/prim/prob/beta_binomial_rng.hpp
@@ -35,7 +35,7 @@ beta_binomial_rng(const T_N &N, const T_shape1 &alpha, const T_shape2 &beta,
using T_N_ref = ref_type_t;
using T_alpha_ref = ref_type_t;
using T_beta_ref = ref_type_t;
- static constexpr const char *function = "beta_binomial_rng";
+ static constexpr const char* function = "beta_binomial_rng";
check_consistent_sizes(function, "First prior sample size parameter", alpha,
"Second prior sample size parameter", beta);
diff --git a/stan/math/prim/prob/beta_proportion_rng.hpp b/stan/math/prim/prob/beta_proportion_rng.hpp
index 61bb114f00f..90ca685786a 100644
--- a/stan/math/prim/prob/beta_proportion_rng.hpp
+++ b/stan/math/prim/prob/beta_proportion_rng.hpp
@@ -36,7 +36,7 @@ inline typename VectorBuilder::type
beta_proportion_rng(const T_loc &mu, const T_prec &kappa, RNG &rng) {
using T_mu_ref = ref_type_t;
using T_kappa_ref = ref_type_t;
- static constexpr const char *function = "beta_proportion_rng";
+ static constexpr const char* function = "beta_proportion_rng";
check_consistent_sizes(function, "Location parameter", mu,
"Precision parameter", kappa);
T_mu_ref mu_ref = mu;
diff --git a/stan/math/prim/prob/beta_rng.hpp b/stan/math/prim/prob/beta_rng.hpp
index 9fdc839bf4e..1f544c857f9 100644
--- a/stan/math/prim/prob/beta_rng.hpp
+++ b/stan/math/prim/prob/beta_rng.hpp
@@ -40,7 +40,7 @@ inline typename VectorBuilder::type beta_rng(
using boost::random::uniform_real_distribution;
using T_alpha_ref = ref_type_t;
using T_beta_ref = ref_type_t;
- static constexpr const char *function = "beta_rng";
+ static constexpr const char* function = "beta_rng";
check_consistent_sizes(function, "First shape parameter", alpha,
"Second shape Parameter", beta);
T_alpha_ref alpha_ref = alpha;
diff --git a/stan/math/prim/prob/gaussian_dlm_obs_rng.hpp b/stan/math/prim/prob/gaussian_dlm_obs_rng.hpp
index 8ae0067b504..d79db9221e7 100644
--- a/stan/math/prim/prob/gaussian_dlm_obs_rng.hpp
+++ b/stan/math/prim/prob/gaussian_dlm_obs_rng.hpp
@@ -92,7 +92,7 @@ inline Eigen::MatrixXd gaussian_dlm_obs_rng(const Eigen::MatrixXd &F,
const Eigen::VectorXd &m0,
const Eigen::MatrixXd &C0,
const int T, RNG &rng) {
- static constexpr const char *function = "gaussian_dlm_obs_rng";
+ static constexpr const char* function = "gaussian_dlm_obs_rng";
int r = F.cols(); // number of variables
int n = G.rows(); // number of states
diff --git a/stan/math/prim/prob/matrix_normal_prec_rng.hpp b/stan/math/prim/prob/matrix_normal_prec_rng.hpp
index e7a1d275fb2..b3d508060a8 100644
--- a/stan/math/prim/prob/matrix_normal_prec_rng.hpp
+++ b/stan/math/prim/prob/matrix_normal_prec_rng.hpp
@@ -35,7 +35,7 @@ inline Eigen::MatrixXd matrix_normal_prec_rng(const Eigen::MatrixXd &Mu,
RNG &rng) {
using boost::normal_distribution;
using boost::variate_generator;
- static constexpr const char *function = "matrix_normal_prec_rng";
+ static constexpr const char* function = "matrix_normal_prec_rng";
check_positive(function, "Sigma rows", Sigma.rows());
check_finite(function, "Sigma", Sigma);
check_symmetric(function, "Sigma", Sigma);
diff --git a/stan/math/prim/prob/multi_normal_prec_rng.hpp b/stan/math/prim/prob/multi_normal_prec_rng.hpp
index b3c7c63f518..a206fa79ea5 100644
--- a/stan/math/prim/prob/multi_normal_prec_rng.hpp
+++ b/stan/math/prim/prob/multi_normal_prec_rng.hpp
@@ -34,7 +34,7 @@ inline typename StdVectorBuilder::type
multi_normal_prec_rng(const T_loc &mu, const Eigen::MatrixXd &S, RNG &rng) {
using boost::normal_distribution;
using boost::variate_generator;
- static constexpr const char *function = "multi_normal_prec_rng";
+ static constexpr const char* function = "multi_normal_prec_rng";
check_positive(function, "Precision matrix rows", S.rows());
vector_seq_view mu_vec(mu);
diff --git a/stan/math/rev/fun/mdivide_left_spd.hpp b/stan/math/rev/fun/mdivide_left_spd.hpp
index 58a4486235c..19488d6befc 100644
--- a/stan/math/rev/fun/mdivide_left_spd.hpp
+++ b/stan/math/rev/fun/mdivide_left_spd.hpp
@@ -154,7 +154,7 @@ mdivide_left_spd(const EigMat1 &A, const EigMat2 &b) {
constexpr int C1 = EigMat1::ColsAtCompileTime;
constexpr int R2 = EigMat2::RowsAtCompileTime;
constexpr int C2 = EigMat2::ColsAtCompileTime;
- static constexpr const char *function = "mdivide_left_spd";
+ static constexpr const char* function = "mdivide_left_spd";
check_multiplicable(function, "A", A, "b", b);
const auto &A_ref = to_ref(A);
check_symmetric(function, "A", A_ref);
@@ -185,7 +185,7 @@ mdivide_left_spd(const EigMat1 &A, const EigMat2 &b) {
constexpr int C1 = EigMat1::ColsAtCompileTime;
constexpr int R2 = EigMat2::RowsAtCompileTime;
constexpr int C2 = EigMat2::ColsAtCompileTime;
- static constexpr const char *function = "mdivide_left_spd";
+ static constexpr const char* function = "mdivide_left_spd";
check_multiplicable(function, "A", A, "b", b);
const auto &A_ref = to_ref(A);
check_symmetric(function, "A", A_ref);
@@ -216,7 +216,7 @@ mdivide_left_spd(const EigMat1 &A, const EigMat2 &b) {
constexpr int C1 = EigMat1::ColsAtCompileTime;
constexpr int R2 = EigMat2::RowsAtCompileTime;
constexpr int C2 = EigMat2::ColsAtCompileTime;
- static constexpr const char *function = "mdivide_left_spd";
+ static constexpr const char* function = "mdivide_left_spd";
check_multiplicable(function, "A", A, "b", b);
const auto &A_ref = to_ref(A);
check_symmetric(function, "A", A_ref);