c and h source file are preprocessed while they should not #363
Labels
conclusion: duplicate
Has already been submitted
conclusion: off topic
Off topic for this repository
type: imperfection
Perceived defect in any part of project
Describe the bug
STM32 core allows user to define some value by adding a build_opt.h file at sketch level.
This file is not a standard header file as it is used by the gcc command line with
@file
option.https://github.com/stm32duino/wiki/wiki/Customize-build-options-using-build_opt.h
To achieve this a simple recipe hooks prebuild is used. When no file exists at sketch level it creates an empty one.
It works fine with Arduino 1.8.x (until 1.8.13 seems 1.8.15 embed the same behaviour)
.h
file extension has been used because Arduino 1.8.x does not allow to create file without a specific extension (ino, c, cpp, h, hpp).But with Arduino IDE Beta 5, this file is preprocessed (seems like the ino file) and add extra line which cause issue to gcc.
For example a build_opt.h with:
-DHAL_CRC_MODULE_ENABLED
is converted to:
Below the build result due to the
#line
addition:To Reproduce
Steps to reproduce the behavior:
build_opt.h
file containing the line-DHAL_CRC_MODULE_ENABLED
Expected behavior
Do not preprocess file and able to build.
Desktop (please complete the following information):
Additional context
It seems that all created files are also preprocess: c, cpp,...
Issue originally reported by an user here:
stm32duino/Arduino_Core_STM32#1387
The text was updated successfully, but these errors were encountered: