Skip to content

stb_herringbone_wang_tile.h:369:41: warning: ‘struct stbhw__process’ declared inside parameter list will not be visible outside of this definition or declaration #1670

@yangfl

Description

@yangfl

Describe the bug

stb_herringbone_wang_tile.h:369:41: warning: ‘struct stbhw__process’ declared inside parameter list will not be visible outside of this definition or declaration
  369 | typedef void stbhw__process_rect(struct stbhw__process *p, int xpos, int ypos,
      |                                         ^~~~~~~~~~~~~~
stb_herringbone_wang_tile.h: In function ‘stbhw__process_h_row’:
stb_herringbone_wang_tile.h:401:43: error: passing argument 1 of ‘p->process_h_rect’ from incompatible pointer type [-Wincompatible-pointer-types]
  401 |                         p->process_h_rect(p, xpos, ypos, a,b,c,d,e,f);
      |                                           ^
      |                                           |
      |                                           stbhw__process *
stb_herringbone_wang_tile.h:401:43: note: expected ‘struct stbhw__process *’ but argument is of type ‘stbhw__process *’
stb_herringbone_wang_tile.h: In function ‘stbhw__process_v_row’:
stb_herringbone_wang_tile.h:425:43: error: passing argument 1 of ‘p->process_v_rect’ from incompatible pointer type [-Wincompatible-pointer-types]
  425 |                         p->process_v_rect(p, xpos, ypos, a,b,c,d,e,f);
      |                                           ^
      |                                           |
      |                                           stbhw__process *
(more to follow)

To Reproduce
Steps to reproduce the behavior:
Use GCC 14 on Debian sid to build stb_herringbone_wang_tile.h.

Expected behavior
Forward declare struct stbhw__process before stbhw__process_rect.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions