0022-com32-modules-pxechn.c-use-proper-type-in-struct-dat.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From b9514337ecfc0efaa04a926713188d87a88bb59e Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Sat, 18 Jan 2025 16:03:34 +0100
  4. Subject: [PATCH] com32/modules/pxechn.c: use proper type in struct data_area
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Use a size_t for the size field, so that we meet the expectations of
  9. the loadfile() function.
  10. Fixes a build issue with GCC >= 14:
  11. com32/modules/pxechn.c:985:38: error: passing argument 3 of ‘loadfile’ from incompatible pointer type [-Wincompatible-pointer-types]
  12. 985 | if (loadfile(pxe.fn, &file.data, &file.size)) {
  13. | ^~~~~~~~~~
  14. | |
  15. | addr_t * {aka unsigned int *}
  16. In file included from com32/modules/pxechn.c:33:
  17. com32/include/syslinux/loadfile.h:11:37: note: expected ‘size_t *’ {aka ‘long unsigned int *’} but argument is of type ‘addr_t *’ {aka ‘unsigned int *’}
  18. 11 | int loadfile(const char *, void **, size_t *);
  19. | ^~~~~~~~
  20. Upstream: N/A, dead
  21. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  22. ---
  23. com32/modules/pxechn.c | 2 +-
  24. 1 file changed, 1 insertion(+), 1 deletion(-)
  25. diff --git a/com32/modules/pxechn.c b/com32/modules/pxechn.c
  26. index e4e21e88..15f008a3 100644
  27. --- a/com32/modules/pxechn.c
  28. +++ b/com32/modules/pxechn.c
  29. @@ -130,7 +130,7 @@ struct pxelinux_opt {
  30. struct data_area {
  31. void *data;
  32. addr_t base;
  33. - addr_t size;
  34. + size_t size;
  35. };
  36. /* From chain.c */
  37. --
  38. 2.47.1