I think that it makes the code look cleaner if the parameter is
definitely unused.
int err = 0;
try {
write_fd(fd, buf, bytes_to_write);
- } catch ([[maybe_unused]] Error& e) {
+ } catch (Error&) {
err = errno;
}
lseek(fd, saved_pos, SEEK_SET);
}
#else
int
-is_nfs_fd([[maybe_unused]] int fd, [[maybe_unused]] bool* is_nfs)
+is_nfs_fd(int /*fd*/, bool* /*is_nfs*/)
{
return -1;
}
// From: https://stackoverflow.com/a/58162122/262458
#ifdef _MSC_VER
int
-gettimeofday(struct timeval* tp, [[maybe_unused]] struct timezone* tzp)
+gettimeofday(struct timeval* tp, struct timezone* /*tzp*/)
{
namespace sc = std::chrono;
sc::system_clock::duration d = sc::system_clock::now().time_since_epoch();