'-Wno-unused-result',
'-Wno-format-signedness',
]
-if get_option('b_ndebug') == 'true'
- # With asserts disabled with get a bunch of warnings about variables which
- # are used only in the asserts. This is not useful at all, so let's just silence
- # those warnings.
- basic_disabled_warnings += [
- '-Wno-unused-variable',
- '-Wno-unused-but-set-variable',
- ]
-endif
possible_cc_flags = [
'-Werror=undef',
void *userdata) {
ExecContext *c = data;
- const Unit *u = userdata;
+ _unused_ const Unit *u = userdata;
bool invert = false;
const char *p;
int r;
progress.limit = (RateLimit) { 200*USEC_PER_MSEC, 1 };
/* Hook into SIGINT/SIGTERM, so that we can cancel things then */
- assert(sigaction(SIGINT, &sa, &old_sigint_sa) >= 0);
- assert(sigaction(SIGTERM, &sa, &old_sigterm_sa) >= 0);
+ assert_se(sigaction(SIGINT, &sa, &old_sigint_sa) >= 0);
+ assert_se(sigaction(SIGTERM, &sa, &old_sigterm_sa) >= 0);
r = btrfs_subvol_snapshot_fd_full(
fd,
static gcry_mpi_t mpi_import(const void *buf, size_t buflen) {
gcry_mpi_t h;
- unsigned len;
+ _unused_ unsigned len;
assert_se(gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL) == 0);
len = (gcry_mpi_get_nbits(h) + 7) / 8;
void *userdata,
sd_bus_error *error) {
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
int r;
assert(message);
void *userdata,
sd_bus_error *error) {
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
int r;
assert(message);
void *userdata,
sd_bus_error *error) {
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
int r;
assert(message);
void *userdata,
sd_bus_error *error) {
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
int r;
assert(message);
static int method_get_image(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_free_ char *p = NULL;
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
const char *name;
int r;
static int method_list_images(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_hashmap_free_ Hashmap *images = NULL;
- Manager *m = userdata;
+ _unused_ Manager *m = userdata;
Image *image;
Iterator i;
int r;
}
static int set_hostname_handler(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
- Manager *manager = userdata;
+ _unused_ Manager *manager = userdata;
const sd_bus_error *e;
assert(m);
}
static int set_timezone_handler(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
- Manager *manager = userdata;
+ _unused_ Manager *manager = userdata;
const sd_bus_error *e;
assert(m);
bool z = false;
size_t c, j = 0;
- assert((c = columns()) >= 2);
+ assert_se((c = columns()) >= 2);
c -= 2; /* We do not use the leftmost and rightmost character cell */
bar = new0(Partition*, c);
int resize_fs(int fd, uint64_t sz, uint64_t *ret_size) {
struct statfs sfs;
- int r;
assert(fd >= 0);
sz -= sz % sfs.f_bsize;
- r = snprintf(args.name, sizeof(args.name), "%" PRIu64, sz);
- assert((size_t) r < sizeof(args.name));
+ xsprintf(args.name, "%" PRIu64, sz);
if (ioctl(fd, BTRFS_IOC_RESIZE, &args) < 0)
return -errno;
g = cp; /* cast from pointer */
h = NULL; /* cast from pointer */
- assert(b);
- assert(c);
- assert(d);
- assert(e);
- assert(!f);
- assert(g);
- assert(!h);
+ assert_se(b);
+ assert_se(c);
+ assert_se(d);
+ assert_se(e);
+ assert_se(!f);
+ assert_se(g);
+ assert_se(!h);
}
static int cleanup_counter = 0;
ssize_t x, y;
x = read(fd1, a, sizeof(a));
- assert(x >= 0);
+ assert_se(x >= 0);
y = read(fd2, b, sizeof(b));
- assert(y >= 0);
+ assert_se(y >= 0);
- assert(x == y);
+ assert_se(x == y);
if (x == 0)
break;
- assert(memcmp(a, b, x) == 0);
+ assert_se(memcmp(a, b, x) == 0);
}
}
else
d = b - a;
- assert(d < 10*USEC_PER_SEC);
+ assert_se(d < 10*USEC_PER_SEC);
}
static void test_usec_shift_clock(void) {