bug: Preprocessor definitions #714
Unanswered
jphaupt
asked this question in
Q&A - deprecated see Fortran Discourse
Replies: 1 comment 6 replies
-
There are 2 different things that are going on.
What you are probably seeing is your linter not knowing about your project configuration and your preprocessor macros. There is no current integration with CMake see #133 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
Description
Sorry if I missed this somewhere. For your convenience, I made a little repo for this issue (+ another issue): https://github.com/jphaupt/min_cmake_preproc/
Let's say I have a preprocessor definition
NUMBER_PREPROCESSED=real
. I then want to use in my codeNUMBER_PREPROCESSED(dp)
. It looks like this is actually picked up correctly, as when you hover over the line it shows you#define NUMBER_PREPROCESSED real
, but it still shows an error, and more importantly it deletes the .mod file (if there was one and if this is a module), which ruins indexing if the module is embedded in a bigger project. This is however valid code, as you can dotarget_compile_definitions(<target> PUBLIC NUMBER_PREPROCESSED=real)
in cmake.Screenshots
No response
Expected Behaviour
I expect it to notice the definition, as it does correctly, but to not show an error and not to delete the .mod file.
Version of Modern Fortran
v3.2.0
Version of Visual Studio Code
1.72.2
Platform and Architecture
Linux
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions