[PATCH v1 09/12] malloctest/init.c: Added pragmas to address gcc 12 warnings

Chris Johns chrisj at rtems.org
Tue Aug 16 23:07:18 UTC 2022


On 17/8/2022 6:11 am, Ryan Long wrote:
> Fixed four warnings disabled were for "-Wuse-after-free" and one for a
> "-Wfree-nonheap-object."

Is this a gcc warning bug? If p1 was used to access the memory the warning is
right but we are only referencing the address and not the data. It is no
different to:

  void* p = 0x111111111;
  printf("P is %p\n", p);

This is fine and has to be or we could never access any hardware.

Chris


More information about the devel mailing list