Menu

#2776 segfault on trying to pass struct

closed-fixed
None
other
5
2023-02-08
2018-07-29
No

SDCC does not yet support passing struct paramters; attempts usually resultin an error. However, in the following code, SDCC segfaults instead:

struct tiny
{
  char c;
};

void f (int n, ...);

main ()
{
  struct tiny x[3];
  x[0].c = 10;
  x[1].c = 11;
  x[2].c = 12;

  f (3, x[0], x[1], x[2], (long) 123);
}

Philipp

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • Philipp Klaus Krause

    As of [r13822], there is no segfault any more. For some ports, this now just works. It fails with an internal error for hc08/s08 and pdk.

     

    Related

    Commit: [r13822]

  • Philipp Klaus Krause

    Fixed in [r13859].

     

    Related

    Commit: [r13859]

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     

Log in to post a comment.