Conversation
|
They have the .c extension because they are part of a .c file. Anyway, you can change them .h. However, I don't want a similar thing in the sljit compiler. |
|
There are two kinds of confusion here. Seeing an inclusion for a .h file in a source makes me think it is some kind of header, not actual code, but I agree that seeing a .c file in a source directory suggests that it should be independently compiled. One way round this is to invent a new extension such as .inc but perhaps a clearer way would be to put included .c files into a subdirectory called "includedcode" (or whatever). Just my thoughts ... do what you think best. |
|
Unfortunately I don't think there is a good solution here :( .c / .h represents a C source file, while .inc is something people (and tools) don't know. Another option is |
|
Oh dear, I'm sorry I opened a can of worms!
Certainly not, I wouldn't touch that. None of the files in there need to be included by clients integrating PCRE2 into their build system.
More strongly than that, some tools actual mandate that behaviour, or make it a strong default that requires an override. I admit I hadn't given it much thought. Options for these "executable header" files:
|
|
Renaming is always debatable because we should do it only once :) The |
|
OK, I like Thanks for discussing! |
adb6158 to
b8c551c
Compare
376bc80 to
7b011c2
Compare
|
I made an update here. The files are renamed
This is after I realised that we already have I don't really care too much about naming! I only felt that they shouldn't be |
|
Anything is good for me as well. Probably we spent to much time on it. |
We have four files which have
.cextensions, but which are actually #included rather than treated as their own compilation unit.This goes against conventions - Autotools, CMake, and Bazel all assume that the .h/.c distinction indicates which files are compilation units.
We even have documentation telling users not to pass the bogus .c files to the compiler!
pcre2_jit_match.c→.hpcre2_jit_misc.c→.hpcre2_printint.c→.hpcre2_ucptables.c→.h