Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1999 SIGSEGV - function pointer in struct

closed-duplicate
Ben Shi
Front-end
5
2015-02-12
2012-03-31
mz-fuzzy
No

Caught signal 11: SIGSEGV for code:

typedef struct {
int (*func)(void);
} struct_t;

int f(void);

struct_t inst = { f };

int f(void)
{
return (-1);
}
==========================

SDCC : mcs51/gbz80/z80/z180/r2k/ds390/pic16/pic14/TININative/ds400/hc08 3.1.4 #7508 (Mar 30 2012) (Linux)

Discussion

  • mz-fuzzy
    mz-fuzzy
    2012-03-31

     
    Attachments
  • mz-fuzzy
    mz-fuzzy
    2012-03-31

    • priority: 5 --> 6
     
  • This is not a silent failure: It is cleary visible to the user. Furthermore, a workaround exists (assigning memeber in main function). Thus using priority 5.

    Philipp

     
    • priority: 6 --> 5
     
  • Ben Shi
    Ben Shi
    2015-02-12

    duplicate to bug #2124, fixed in reversion #9178.

     
  • Ben Shi
    Ben Shi
    2015-02-12

    • status: open --> closed-duplicate
    • assigned_to: Ben Shi
    • Category: --> Front-end