khiops
khiops copied to clipboard
Stop Outputting `#line` directives in Flex and Bison Output `.cpp`/ `.h` Files
Description
Currently, #line preprocessor directives with absolute paths are outputted in the following files:
src/Learning/KWData/KWCLex.inc
src/Learning/KWData/KWCYac.cpp
src/Learning/KWData/KWCYac.hpp
src/Norm/base/JSONLex.inc
src/Norm/base/JSONYac.cpp
src/Norm/base/JSONYac.hpp
These directives contain absolute paths, which:
- can leak local machine-specific details
- are not directly portable to other machines (for other developers).
Questions/Ideas
The goal of this issue is to add:
%nolineoption to Flex%no-lineoption to Bison so that#linedirectives are not outputted anymore. These directives would only be used during development, on the local machine of the developer, but would not be committed anymore.
Context
- Khiops version: >= 11
- OS description (use
khiops -s): All supported.
3 stages:
- add CMake option to generate these files w/o #line directives
- document convention to generate these files w/o #line before committing them
- add pre-commit hook to warn on the presence of #line directives in these files.