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

Perl.c fails to compile with clang #4308

Closed
jvsg opened this issue May 8, 2024 · 0 comments · Fixed by #4309
Closed

Perl.c fails to compile with clang #4308

jvsg opened this issue May 8, 2024 · 0 comments · Fixed by #4309

Comments

@jvsg
Copy link
Contributor

jvsg commented May 8, 2024

  • Version of collectd: main on ff8cd79667fa379f3088a927e75e989bc996fccc
  • Operating system / distribution: MacOS with clang

Expected behavior

make should compile cleanly

Actual behavior

src/perl.c:1081:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    XPUSHs(sv_2mortal(newSVpv(va_arg(ap, char *), 0)));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/pp.h:462:19: note: expanded from macro 'XPUSHs'
#define XPUSHs(s)       STMT_START { EXTEND(sp,1); *++sp = (s); } STMT_END
                        ^~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/perl.h:544:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
src/perl.c:1081:5: note: '{' token is here
    XPUSHs(sv_2mortal(newSVpv(va_arg(ap, char *), 0)));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/pp.h:462:30: note: expanded from macro 'XPUSHs'
#define XPUSHs(s)       STMT_START { EXTEND(sp,1); *++sp = (s); } STMT_END
                                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Steps to reproduce

  • ./configure
  • make
jvsg added a commit to jvsg/collectd that referenced this issue May 8, 2024
jvsg added a commit to jvsg/collectd that referenced this issue May 8, 2024
jvsg added a commit to jvsg/collectd that referenced this issue May 10, 2024
A new warning type introduced since clang 12 causes a build failure.
Ignore it to fix.

https://reviews.llvm.org/D86751

Fixes: collectd#4308
mrunge pushed a commit that referenced this issue May 21, 2024
A new warning type introduced since clang 12 causes a build failure.
Ignore it to fix.

https://reviews.llvm.org/D86751

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

Successfully merging a pull request may close this issue.

1 participant