Skip to content

Commit

Permalink
Force C17 standard in qrexec-lib/validator-test.c
Browse files Browse the repository at this point in the history
GCC 17 defaults to -std=gnu23, which changes type of u8 string
constants. This breaks the validator, as
qubes_pure_string_safe_for_display expects 'const char *' not 'const
unsigned char *'.

The specific error message is:

validator-test.c:286:48: error: pointer targets in passing argument 1 of ...qubes_pure_string_safe_for_display... differ in signedness [-Werror=pointer-sign]
  286 |     assert(!qubes_pure_string_safe_for_display(u8"\U0001f3f3", 0));
      |                                                ^~~~~~~~~~~~~~
      |                                                |
      |                                                unsigned char *
In file included from validator-test.c:6:
pure.h:199:48: note: expected ...const char *... but argument is of type ...unsigned char *...
  199 | qubes_pure_string_safe_for_display(const char *untrusted_str,
      |                                    ~~~~~~~~~~~~^~~~~~~~~~~~~
validator-test.c:286:48: error: pointer targets in passing argument 1 of ...qubes_pure_string_safe_for_display... differ in signedness [-Werror=pointer-sign]
  286 |     assert(!qubes_pure_string_safe_for_display(u8"\U0001f3f3", 0));
      |                                                ^~~~~~~~~~~~~~
      |                                                |
      |                                                unsigned char *
pure.h:199:48: note: expected ...const char *... but argument is of type ...unsigned char *...
  199 | qubes_pure_string_safe_for_display(const char *untrusted_str,
      |                                    ~~~~~~~~~~~~^~~~~~~~~~~~~

QubesOS/qubes-issues#9807
  • Loading branch information
marmarek committed Feb 25, 2025
1 parent 41f3617 commit 30783de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qrexec-lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $(pure_objs): CFLAGS += -fvisibility=hidden -DQUBES_PURE_IMPLEMENTATION
ifeq ($(CHECK_UNREACHABLE),1)
$(pure_objs): CFLAGS += -DCHECK_UNREACHABLE
endif
validator-test: CFLAGS += -UNDEBUG
validator-test: CFLAGS += -UNDEBUG -std=gnu17
check: validator-test
LD_LIBRARY_PATH=. ./validator-test

Expand Down

0 comments on commit 30783de

Please sign in to comment.