Mercurial > hg > index.cgi
comparison Makefile @ 545:1fa6eca684e5
Silence spurious warning in lwcpp build
GCC has a stupid-ass warning about snprintf() truncating its output if its
return value isn't tested. But that's the bleeping point of snprintf() in
the first place - that it will truncate its output. Why should I need to add
completely pointless extra code to check a return value *that doesn't
matter* in my specific use case just to shut up an overwrought warning. So
disable the stupid-ass warning.
Why, yes, I do have a strong opinion. Why do you ask?
author | William Astle <lost@l-w.ca> |
---|---|
date | Thu, 16 Mar 2023 16:02:01 -0600 |
parents | 724bcc4508bc |
children | 80b21c6b4a6b |
comparison
equal
deleted
inserted
replaced
544:f12c767c363e | 545:1fa6eca684e5 |
---|---|
42 CPPFLAGS += -I lwlib -Icommon | 42 CPPFLAGS += -I lwlib -Icommon |
43 CPPFLAGS += -DPREFIX=$(PREFIX) -DLWCC_LIBDIR=$(LWCC_LIBDIR) | 43 CPPFLAGS += -DPREFIX=$(PREFIX) -DLWCC_LIBDIR=$(LWCC_LIBDIR) |
44 CPPFLAGS += -DPROGSUFFIX=$(PROGSUFFIX) | 44 CPPFLAGS += -DPROGSUFFIX=$(PROGSUFFIX) |
45 LDFLAGS += -Llwlib -llw | 45 LDFLAGS += -Llwlib -llw |
46 | 46 |
47 CFLAGS ?= -O3 -Wall -Wno-char-subscripts | 47 # The format truncation warnings are bleeping stupid when applied to |
48 # snprintf() and friends. I'm using snprintf() precisely to prevent | |
49 # overflows and I don't care if the string is truncated, so why should | |
50 # I need to test the return value? Bleeping stupid. | |
51 CFLAGS ?= -O3 -Wall -Wno-char-subscripts -Wno-format-truncation | |
48 | 52 |
49 MAIN_TARGETS := lwasm/lwasm$(PROGSUFFIX) \ | 53 MAIN_TARGETS := lwasm/lwasm$(PROGSUFFIX) \ |
50 lwlink/lwlink$(PROGSUFFIX) \ | 54 lwlink/lwlink$(PROGSUFFIX) \ |
51 lwar/lwar$(PROGSUFFIX) \ | 55 lwar/lwar$(PROGSUFFIX) \ |
52 lwlink/lwobjdump$(PROGSUFFIX) \ | 56 lwlink/lwobjdump$(PROGSUFFIX) \ |