0001-build-remove-warnings-with-gcc-11.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 6db49eb8858023654084088c73d968e190aec491 Mon Sep 17 00:00:00 2001
  2. From: Rene Kita <git@rkta.de>
  3. Date: Fri, 12 Mar 2021 18:38:02 +0100
  4. Subject: [PATCH] build: remove warnings with gcc 11
  5. This removes some warnings which prevent a successful build with -Werror
  6. which is enabled by default. I'm using gcc 11, so maybe others are not
  7. getting this warnings yet.
  8. In src/flash/nor/numicro.c the debug messages were misleadingly indented.
  9. In src/target/arm920t.c the array size where smaller than expected from
  10. the receiving function.
  11. Change-Id: I66f5c6a63beb9f9416e73b726299297476c884d8
  12. Signed-off-by: Rene Kita <git@rkta.de>
  13. Reviewed-on: http://openocd.zylin.com/6104
  14. Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
  15. Tested-by: jenkins
  16. Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
  17. Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
  18. ---
  19. src/flash/nor/numicro.c | 6 +++---
  20. src/target/arm920t.c | 6 +++---
  21. 2 files changed, 6 insertions(+), 6 deletions(-)
  22. diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c
  23. index 7609fa81c..1971daa24 100644
  24. --- a/src/flash/nor/numicro.c
  25. +++ b/src/flash/nor/numicro.c
  26. @@ -1243,7 +1243,7 @@ static uint32_t numicro_fmc_cmd(struct target *target, uint32_t cmd, uint32_t ad
  27. retval = target_read_u32(target, NUMICRO_FLASH_ISPTRG, &status);
  28. if (retval != ERROR_OK)
  29. return retval;
  30. - LOG_DEBUG("status: 0x%" PRIx32 "", status);
  31. + LOG_DEBUG("status: 0x%" PRIx32 "", status);
  32. if ((status & (ISPTRG_ISPGO)) == 0)
  33. break;
  34. if (timeout-- <= 0) {
  35. @@ -1512,7 +1512,7 @@ static int numicro_erase(struct flash_bank *bank, unsigned int first,
  36. retval = target_read_u32(target, NUMICRO_FLASH_ISPTRG, &status);
  37. if (retval != ERROR_OK)
  38. return retval;
  39. - LOG_DEBUG("status: 0x%" PRIx32 "", status);
  40. + LOG_DEBUG("status: 0x%" PRIx32 "", status);
  41. if (status == 0)
  42. break;
  43. if (timeout-- <= 0) {
  44. @@ -1601,7 +1601,7 @@ static int numicro_write(struct flash_bank *bank, const uint8_t *buffer,
  45. retval = target_read_u32(target, NUMICRO_FLASH_ISPTRG, &status);
  46. if (retval != ERROR_OK)
  47. return retval;
  48. - LOG_DEBUG("status: 0x%" PRIx32 "", status);
  49. + LOG_DEBUG("status: 0x%" PRIx32 "", status);
  50. if (status == 0)
  51. break;
  52. if (timeout-- <= 0) {
  53. diff --git a/src/target/arm920t.c b/src/target/arm920t.c
  54. index 80f6d7045..a45dc6420 100644
  55. --- a/src/target/arm920t.c
  56. +++ b/src/target/arm920t.c
  57. @@ -245,8 +245,8 @@ static int arm920t_read_cp15_interpreted(struct target *target,
  58. uint32_t cp15_opcode, uint32_t address, uint32_t *value)
  59. {
  60. struct arm *arm = target_to_arm(target);
  61. - uint32_t *regs_p[1];
  62. - uint32_t regs[2];
  63. + uint32_t *regs_p[16];
  64. + uint32_t regs[16];
  65. uint32_t cp15c15 = 0x0;
  66. struct reg *r = arm->core_cache->reg_list;
  67. @@ -295,7 +295,7 @@ int arm920t_write_cp15_interpreted(struct target *target,
  68. {
  69. uint32_t cp15c15 = 0x0;
  70. struct arm *arm = target_to_arm(target);
  71. - uint32_t regs[2];
  72. + uint32_t regs[16];
  73. struct reg *r = arm->core_cache->reg_list;
  74. /* load value, address into R0, R1 */
  75. --
  76. 2.35.1