Skip to content

Conversation

@sharpeye
Copy link
Contributor

@sharpeye sharpeye commented Nov 25, 2025

Fixes C++ compilation errors. The code uses pointer arithmetic on void*, which is a GNU C extension that works in C mode but is not allowed in C++.

Error example:

error: arithmetic on a pointer to void
   43 |         hi = *(const volatile uint32_t __force *)(addr + 4);
      |                                                   ~~~~ ^

@sharpeye sharpeye marked this pull request as ready for review November 25, 2025 20:58
@birkelund
Copy link
Collaborator

It compiles just fined under clang 19, so please be clear in the commit message that this is because the static inline functions use a GNU C extension that is not allowed by default for C++.

I'm more used to void *, but I get the pain due to using the headers from C++, so I'm fine with fixing up the headers here.

@sharpeye sharpeye force-pushed the fix-cpp-compilation branch from 2402c1f to 4b7745b Compare November 26, 2025 21:36
@sharpeye sharpeye changed the title fix compilation under clang Fix C++ compilation: cast void* before pointer arithmetic Nov 26, 2025
@sharpeye sharpeye requested a review from birkelund November 26, 2025 21:42
@birkelund
Copy link
Collaborator

@sharpeye you can ignore the build failure on oracular and checkpatch complaining about volatile, but please add your sign-off ;)

Signed-off-by: Pavel Misko <misko.pawel@gmail.com>
@sharpeye sharpeye force-pushed the fix-cpp-compilation branch from 4b7745b to 118ccb9 Compare November 27, 2025 10:22
@birkelund
Copy link
Collaborator

Merged; Thanks!

@birkelund birkelund closed this Nov 27, 2025
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

Successfully merging this pull request may close these issues.

2 participants