Skip to content

The -U (Undefined) preprocessor symbols are deleted #1407

@psuzzi

Description

@psuzzi

Describe the bug
In My CDT C Project, from Project Properties > C/C++Build > Settings, in the Tool Settings tab under the node Cross GCC Compiler > Preprocessor - I can set Undefined Symbols correctly. (see image-1)
But when I go to Project Properties > C/C++ General > Paths and Symbols, in the Symbols tab - to set Preprocessor Symbols, after applying, the Undefined Symbols set previously are removed

To Reproduce
Steps to reproduce the behavior:

  • Go to "C/C++ Build > Settings > Tool Settings > C Compiler > Preprocessor"
  • Add undefined symbols in "Undefined symbols (-U)" section (e.g., UNDEF1, UNDEF2)
  • Apply and close
  • Go to "C/C++ General > Paths and Symbols > Symbols"
  • Add any new defined symbol (e.g., TEST_SYMBOL=1)
  • Apply and close
  • Return to "C/C++ Build > Settings" - undefined symbols are gone

Expected behavior
The undefined symbols are not deleted from the C Compiler > Preprocessor

Screenshots
These screenshots guide to reproduce the bug:

Image Image Image Image

Version Information (please complete the following information):

  • OS and OS Version/extra details: Windows 10
  • Eclipse Version from Help -> About Version: 2024-12 (4.34.0)
  • CDT Version from Help -> About -> Installation Details -> Features tab : Eclipse CDT C/C++ Development Platform 11.2.0.202306051917 org.eclipse.cdt.platform

Additional context
To identify the issue, just set a breakpoint in ResourceInfo.setOption(IHoldsOptions, IOption, String[])
And observe that every time we call the CLanguageSetting.setSettingEntries(int, List), de facto we read all the preprocessor symbols and rewrite them, except for the Undefined options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions