Menu ▾ ▴

#2860 segfault on missing parameter type in function prototype (and on old-style functions)

closed-fixed
None
other
5
2026-10-20
2019-01-02
No

When the type of a paramter is missing in the prototype of a function returning a pointer, e.g.

extern void *f(g);

sdcc segfaults. I see this using sdcc 3.8.4 #10788 on debian GNU/Linux, but the issue has been around for a while.

I also see the segfault for an old-style function:

extern void *f(g)
int g;
{
}

Philipp

Discussion

  • Christopher Bazley

    • assigned_to: Christopher Bazley
     
  • Christopher Bazley

    Both original forms avoid SIGSEGV; the old-style definition only warns about its unused parameter.

    https://godbolt.org/z/6M6EY9ohT

     
  • Christopher Bazley

    • status: open --> closed-fixed
     
  • Christopher Bazley

    Regression test added in [r17052]

     

    Related

    Commit: [r17052]


Log in to post a comment.