-
Notifications
You must be signed in to change notification settings - Fork 1
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
spaces are incorrectly elided in strings defined by macros #5
Comments
@bcantrill I suspect it would be valuable to investigate the preprocessor from the Portable C Compiler as a potential replacement. I've built a It seems to be small (234KiB!) and self-contained (unlike, say, the preprocessor from GCC or Clang), and supports C99. Could you replace your |
Well, this has been an antiques roadshow. So, the PCC #include <sys/machtypes.h>
BEGIN
{
exit(0);
} This fails with the PCC # dtrace -I/usr/include -x cpppath=/data/cpp.pcc -Cs ./machtypes.d
dtrace: failed to compile script ./machtypes.d: "/usr/include/sys/machtypes.h", line 59: type redeclared: struct _label_t But this works with both Sun # dtrace -I/usr/include -x cpppath=/data/SUNWdtrt-deps/gcc-12/bin/cpp -Cs ./machtypes.d
<command-line>: warning: "__STDC__" redefined
dtrace: script './machtypes.d' matched 1 probe
CPU ID FUNCTION:NAME
77 1 :BEGIN
Here is the output of Sun
Here is the output of GCC
By contrast, here is the output of PCC
In particular, note the difference in control line: both Sun And here is the explanation from GCC about its meaning: https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html So this directive is -- for the moment anyway -- load bearing for DTrace; we will need to either find a way to emit the directive from PCC's |
I might have dealt with this in the work that is encapsulated by: #1 An ancient effort I don't remember to make this |
Take the following:
This is the kind of output we would expect:
In antiquarian CPP, however:
This is due to fixing TritonDataCenter/smartos-live#171, and in particular, this code:
cpp/src/cpp.c
Lines 1307 to 1318 in f75fd24
Unforunately, this behavior is causing a DTrace test suite failure, as macros in https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d contain spaces that are being incorrectly elided.
It's unclear how hard this would be to fix or if the cure is worse than the disease on this one. If DTrace is the only consumer (but it sounds like
as
is also still a consumer?), it would probabably be be worth moving to an ANSI-compatible CPP in/usr/lib
.The text was updated successfully, but these errors were encountered: