-
Notifications
You must be signed in to change notification settings - Fork 274
Open
Description
OS: Linux
EDITOR: neovim
CC: gcc
VERSION 0.20250815.1
It appears that C++ is assumed over C, in *.h header files.
Personally, I am under the opinion C++ should leave C++-specific code in *.hh or *.hpp or whatever other combination of file extensions were standard. But, this isn't the case and I cannot do anything about that.
I am unaware how the code is structured, and I might take a peek at a later date. However, some potential solutions I have in mind are:
- "pretending" a macro is defined for
restrictpointing to__restrict__, this might signal to the user that some funky stuff may be happening torestrict. - Otherwise, mark
restrictas a valid keyword in*.hfiles, and let the compiler solve the confusion on the user's end.
Interestingly, when I defined a macro in my codebase like this:
#if defined(__cplusplus)
#define restrict __restrict__
#endifIt is assumed that the restrict qualifier is using the macro.

Metadata
Metadata
Assignees
Labels
No labels