Skip to content

Commit

Permalink
make: Use -Wno-maybe-uninitialized
Browse files Browse the repository at this point in the history
This has way too many false positives and is beholden to a lot of
compiler heuristics, and is affected by -fexception and -flto.

Closes #215.
  • Loading branch information
cdown committed Apr 14, 2024
1 parent e98b3f3 commit 145de37
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CFLAGS := -std=gnu11 -O2 -Wall -Wextra -Wshadow -Wpointer-arith \
-Wcast-align -Wmissing-prototypes -Wstrict-overflow -Wformat=2 \
-Wwrite-strings -Warray-bounds -Wstrict-prototypes \
-Wno-maybe-uninitialized \
-Werror $(CFLAGS)
CPPFLAGS += -I/usr/X11R6/include -L/usr/X11R6/lib
LDLIBS += -lX11 -lXfixes
Expand Down
3 changes: 1 addition & 2 deletions src/clipmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static int _nonnull_ interact_with_dmenu(struct config *cfg, int *input_pipe,
int forced_ret = 0;
if (str_to_uint64(sel_idx_str, &sel_idx) < 0 || sel_idx == 0 ||
sel_idx > cur_clips) {
*out_hash = HASH_INVALID;
forced_ret = EXIT_FAILURE;
} else {
*out_hash = idx_to_hash[sel_idx - 1];
Expand Down Expand Up @@ -180,7 +179,7 @@ int main(int argc, char *argv[]) {
uint64_t hash;
int dmenu_exit_code = prompt_user_for_hash(&cfg, &hash);

if (dmenu_exit_code == EXIT_SUCCESS && hash != HASH_INVALID) {
if (dmenu_exit_code == EXIT_SUCCESS) {
run_clipserve(hash);
}

Expand Down
3 changes: 1 addition & 2 deletions src/clipserve.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ static void _nonnull_ serve_clipboard(uint64_t hash,
}

int main(int argc, char *argv[]) {
uint64_t hash = HASH_INVALID;

die_on(argc != 2, "Usage: clipserve [hash]\n");
_drop_(config_free) struct config cfg = setup("clipserve");

uint64_t hash;
expect(str_to_uint64(argv[1], &hash) == 0);

_drop_(close) int content_dir_fd = open(get_cache_dir(&cfg), O_RDONLY);
Expand Down
1 change: 0 additions & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#endif

#define UINT64_MAX_STRLEN 20 // (1 << 64) - 1 is 20 digits wide
#define HASH_INVALID UINT64_MAX

#define streq(a, b) (strcmp((a), (b)) == 0)
#define strceq(a, b) (strcasecmp((a), (b)) == 0)
Expand Down

0 comments on commit 145de37

Please sign in to comment.