Skip to content

Add .inc as a header file type. #9715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2019
Merged

Conversation

bridadan
Copy link
Contributor

Description

This was brought up by a thread on one of the TF-M prs. They are integrating an existing project into Mbed OS, and the existing project uses .inc files for some generated headers.

Currently, if you were to add a directory that only contained .inc files, this file would not be passed as an include path to the compiler. This ensures that .inc files are also considered header files.

Their build just so happens to work because the .inc files are generated in a directory that also contains a .h file. So the directory is marked as an include path.

I think this qualifies as a "fix" but let me know if I should change it.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@theotherjimmy

Currently, if you were to add a directory that only contained .inc
files, this file would not be passed as an include path to the compiler.
This ensures that .inc files are also considered header files.
@cmonr
Copy link
Contributor

cmonr commented Feb 14, 2019

It's a fix and it's fine, but do we want to support this as a valid header file type?

@cmonr
Copy link
Contributor

cmonr commented Feb 14, 2019

#9653 (comment)

Ah, that would be why. Poop.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially approved but rethink this

Do we want to support .inc , is this valid extension and not just "one project has it, we add it" ? When should I choose .h/hh/hpp or inc ? I find .inc to have special meaning , some projects do it that way.

If this approved, do we have this documented ? extensions supported and why inc is in there (what should be in the file, is it regular header file, is it special like only templates, or even some code file) .

TF-M actually generated these files according to their secure partitions manifests.

Probably this will be the description for having .inc supported.

@mikisch81
Copy link
Contributor

@0xc0170 than what do you suggest? patching an external imported code and replace all includes of .inc files to .h? Raising a bug to TF-M to replace their extension? How will you explain the reason for it?

From a short googling I can see that it is a valid extention for headers:
https://fileinfo.com/extension/inc.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2019

I just want to have this documented if we support it - "what extensions we support" that is it. Not repatching external code as .inc is valid extension.

@mikisch81
Copy link
Contributor

Where should it be documented?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2019

@bridadan
Copy link
Contributor Author

Hi @0xc0170, I wasn't aware of that doc, I'll add it to the list

@bridadan
Copy link
Contributor Author

Hi @0xc0170, I've read that .inc files are sometimes used to differentiate written .h files and generated .inc files. @mikisch81 can confirm but I believe these .inc files are generated in this case.

I've also added a corresponding doc update, thanks again for the prod: ARMmbed/mbed-os-5-docs#952

@cmonr
Copy link
Contributor

cmonr commented Feb 14, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 14, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@cmonr cmonr merged commit 9e6c723 into ARMmbed:master Feb 15, 2019
@0xc0170 0xc0170 mentioned this pull request Feb 15, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants