Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros with volatile: result contains non-D "volatile" keyword #239

Open
denizzzka opened this issue Jan 18, 2020 · 0 comments
Open

Macros with volatile: result contains non-D "volatile" keyword #239

denizzzka opened this issue Jan 18, 2020 · 0 comments

Comments

@denizzzka
Copy link

denizzzka commented Jan 18, 2020

C header:

unsigned int val;

#define MMIO32(addr)             (*(volatile unsigned int *)(addr))
#define VOL_VAL     MMIO32(&val)

dpp code what uses this macros:

VOL_VAL |= 1;

Produced D code:

 ( * ( volatile uint32_t * ) ( & val ) ) |= 1; // contains non-D "volatile" keyword

Compilation error:

test.d(11657): Error: found uint32_t when expecting )
test.d(11657): Error: expression expected, not )
@denizzzka denizzzka reopened this Jan 18, 2020
@denizzzka denizzzka changed the title Macros as value error Macros as volatile value Jan 18, 2020
@denizzzka denizzzka changed the title Macros as volatile value Macros with volatile Jan 18, 2020
@denizzzka denizzzka changed the title Macros with volatile Macros with volatile: result contains non-D "volatile" keyword Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant