Skip to content
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

Using .hpp for header filename causes .cpppp for source file #44

Closed
MatthewScholefield opened this issue Jun 1, 2021 · 3 comments · Fixed by #46
Closed

Using .hpp for header filename causes .cpppp for source file #44

MatthewScholefield opened this issue Jun 1, 2021 · 3 comments · Fixed by #46
Labels

Comments

@MatthewScholefield
Copy link
Contributor

It makes sense that foo.h leads to foo.cpp but foo.hpp now also leads to foo.cpp.

Command:

$ dd if=/dev/urandom bs=1M count=10 of=data.bin
$ bin2cpp --file=data.bin --headerfile="foo.hpp" --output=. --identifier=Foo
bin2cpp v2.4.0 - Convert binary files into C++ source code.
Copyright (C) 2013-2021 end2endzone.com. All rights reserved.
bin2cpp is open source software, see http://github.com/end2endzone/bin2cpp 
Embedding "data.bin"...
Writing file "./foo.hpp"...
Writing file "./foo.cpppp"...
@end2endzone
Copy link
Owner

Hi. I can't believe I missed that. I do not use hpp files myself (as you can see from bin2cpp source code) but I know many people uses them and did not thought to look at this in unit tests.

Thank you for spotting that one!
I will take a look at PR #46. Please allow me some time to look at it.

@end2endzone
Copy link
Owner

On a side note, do you think it would be more appropriate to rename all headers from bin2cpp source code to *.hpp ? I mainly use Visual Studio 2017 for developing and even Visual Studio's class wizard uses *.h for C++ headers. Is this something expected by linux/mac users ? My understanding is that *.hpp is strictly for C++ while *.h can be either C or C++.

@MatthewScholefield
Copy link
Contributor Author

MatthewScholefield commented Jun 3, 2021

On a side note, do you think it would be more appropriate to rename all headers from bin2cpp source code to *.hpp ? I mainly use Visual Studio 2017 for developing and even Visual Studio's class wizard uses *.h for C++ headers. Is this something expected by linux/mac users ? My understanding is that *.hpp is strictly for C++ while *.h can be either C or C++.

I have a habit of using .hpp because it's explicit that it's C++ (ie, since c++ header files are fundamentally a different language than c header files, I think a different extension makes sense).

But it's purely preference; nothing to do with platform or editors for me.

Note: I accidentally hit close issue which is why I closed and reopened it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants