Skip to content

Commit 5054d59

Browse files
i#7718 offsetof: Add verbose warnings for deprecated options (#7742)
Modern C++ compilers give a warning when offsetof() is used with structs containing non-POD fields. Consequently we removed the struct size check with its error return and now just output a warning when deprecated fields are used. Issue: #7718
1 parent 339108a commit 5054d59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clients/drcachesim/scheduler/scheduler_impl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,9 @@ scheduler_impl_tmpl_t<RecordType, ReaderType>::legacy_field_support()
11051105
return sched_type_t::STATUS_ERROR_INVALID_PARAMETER;
11061106
}
11071107
if (options_.quantum_duration > 0) {
1108+
VPRINT(this, 1,
1109+
"quantum_duration is deprecated; use quantum_duration_us and "
1110+
"time_units_per_us or quantum_duration_instrs");
11081111
if (options_.quantum_unit == sched_type_t::QUANTUM_INSTRUCTIONS) {
11091112
options_.quantum_duration_instrs = options_.quantum_duration;
11101113
} else {
@@ -1121,6 +1124,9 @@ scheduler_impl_tmpl_t<RecordType, ReaderType>::legacy_field_support()
11211124
return sched_type_t::STATUS_ERROR_INVALID_PARAMETER;
11221125
}
11231126
if (options_.block_time_scale > 0) {
1127+
VPRINT(this, 1,
1128+
"block_time_scale is deprecated; use block_time_multiplier "
1129+
"and time_units_per_us");
11241130
options_.block_time_multiplier =
11251131
static_cast<double>(options_.block_time_scale) / options_.time_units_per_us;
11261132
VPRINT(this, 2, "Legacy support: setting block_time_multiplier to %6.3f\n",
@@ -1131,6 +1137,9 @@ scheduler_impl_tmpl_t<RecordType, ReaderType>::legacy_field_support()
11311137
return sched_type_t::STATUS_ERROR_INVALID_PARAMETER;
11321138
}
11331139
if (options_.block_time_max > 0) {
1140+
VPRINT(this, 1,
1141+
"block_time_max is deprecated; use block_time_max_us "
1142+
"and time_units_per_us");
11341143
options_.block_time_max_us = static_cast<uint64_t>(
11351144
static_cast<double>(options_.block_time_max) / options_.time_units_per_us);
11361145
VPRINT(this, 2, "Legacy support: setting block_time_max_us to %" PRIu64 "\n",

0 commit comments

Comments
 (0)