Skip to content

Refactor pragma usage in C/C++ code by using dedicated include files #3595

Description

@jimklimov

PR #3590 has demonstrated the possibility of using headers to offload repetitive code like pragma start/end incantations we use to quiesce certain warnings (like when compilers both require all pre-known switch/case possibilities to be covered including a default, and that it would never be visited for an enum with all values listed explicitly).

This issue is a relatively low-hanging fruit about identifying pragma combos that are frequently used, and replacing such instances with header files to begin and end a block by a couple of dedicated include files per combo (not sure "header files" would be the right term if we #include them many times in the middle of C source code). This would significantly shorten actual codebase in some files and make it more readable and maintainable.

Kudos to @user01010111 for being the first to try this idea in practice!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Low-hanging fruitA proposal or issue that is good for newcomers to codebase or otherwise a quick winportabilityWe want NUT to build and run everywhere possiblerefactor/fightwarnPR or issue proposal to improve code maintainability without functional changes, or to fix warnings

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions