ckaestne / TypeChef

Type checking ifdef variability
https://ckaestne.github.io/TypeChef/
Other
76 stars 36 forks source link

Normalize signatures before linking #18

Closed ckaestne closed 10 years ago

ckaestne commented 11 years ago

There are several cases that are compatible or even equivalent, that the linker currently complains about.

Especially, we should filter void parameters and translate arrays to pointers.

Examples

** processing arch/x86/xen **
parsing11 files
composing
 * xen_init_irq_ops when !CONFIG_XEN
    xen_init_irq_ops: (void) => void        if CONFIG_XEN       at l/arch/x86/xen/enlighten:0:0
    xen_init_irq_ops: () => void        if CONFIG_XEN       at l/arch/x86/xen/irq:0:0

** processing drivers/isdn/capi **
parsing7 files
composing
 * capi20_get_manufacturer when !CONFIG_ISDN | CONFIG_ISDN & !CONFIG_ISDN_CAPI | CONFIG_ISDN & CONFIG_ISDN_CAPI & !CONFIG_ISDN_CAPI_CAPI20 & !CONFIG_ISDN_CAPI_CAPIDRV
    capi20_get_manufacturer: (unsigned int, unsigned char[]) => unsigned short      if CONFIG_ISDN & CONFIG_ISDN_CAPI & !CONFIG_ISDN_CAPI_CAPI20 & CONFIG_ISDN_CAPI_CAPIDRV | CONFIG_ISDN & CONFIG_ISDN_CAPI & CONFIG_ISDN_CAPI_CAPI20      at l/drivers/isdn/capi/capi:0:0, l/drivers/isdn/capi/capidrv:0:0
    capi20_get_manufacturer: (unsigned int, *unsigned char) => unsigned short       if CONFIG_ISDN & CONFIG_ISDN_CAPI       at l/drivers/isdn/capi/kcapi:0:0

** processing drivers/isdn/hardware/eicon **
parsing29 files
composing
 * DIVA_DIDD_Read when !CONFIG_ISDN | CONFIG_ISDN & !CONFIG_CAPI_EICON | CONFIG_ISDN & CONFIG_CAPI_EICON & !CONFIG_ISDN_DIVAS_DIVACAPI | CONFIG_ISDN & CONFIG_CAPI_EICON & CONFIG_ISDN_DIVAS_DIVACAPI & !CONFIG_ISDN_DIVAS
    DIVA_DIDD_Read: (*struct {Map()}, signed int) => void       if CONFIG_ISDN & CONFIG_CAPI_EICON & CONFIG_ISDN_DIVAS_DIVACAPI     at l/drivers/isdn/hardware/eicon/capifunc:0:0
    DIVA_DIDD_Read: (*void, signed int) => void     if CONFIG_ISDN & CONFIG_CAPI_EICON & CONFIG_ISDN_DIVAS      at l/drivers/isdn/hardware/eicon/dadapter:0:0

** processing drivers/video/sis **
parsing5 files
composing
 * SiS_SetCH70xxANDOR when !CONFIG_FB_SIS
    SiS_SetCH70xxANDOR: (*struct SiS_Private, unsigned short, unsigned char, unsigned short) => void        if CONFIG_FB_SIS        at l/drivers/video/sis/init301:0:0
    SiS_SetCH70xxANDOR: (*struct SiS_Private, unsigned short, unsigned char, unsigned char) => void     if CONFIG_FB_SIS        at l/drivers/video/sis/sis_main:0:0
joliebig commented 10 years ago

Push issue. When creating a linking interface for OpenSSL we frequently run into this issue and its a tedious job to rewrite the code so that linking errors do not occur anymore.

ckaestne commented 10 years ago

for future reference: http://www.spinellis.gr/pubs/jrnl/1993-JCLT-CType/html/tsl.html