Skip to content

CBMC fails to parse constructor attribute with argument #8688

@archigup

Description

@archigup

CBMC parses non-argument constructor attributes correctly but fails to parse them when they have an argument.

Steps to reproduce:

test.c:

__attribute__((constructor(101))) void foo(void) {
}

int main(void) {
}

output:

$ cbmc test.c 
CBMC version 6.7.1 (n/a) 64-bit x86_64 linux
file test.c line 1: syntax error before '('
PARSING ERROR
6$ 

I think it would be fine if CBMC ignored the argument and treated it the same way as constructor without an argument (would be fine for all of our use cases at least).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions