• Arnaldo Carvalho de Melo's avatar
    perf scripting perl: Ignore some warnings to keep building with perl headers · 63a4354a
    Arnaldo Carvalho de Melo authored
    On gcc 12 we started seeing this:
    
      In file included from /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/perl.h:2999,
                       from util/scripting-engines/trace-event-perl.c:35:
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/inline.h: In function 'Perl_is_utf8_valid_partial_char_flags':
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/handy.h:125:23: error: cast from function call of type 'STRLEN' {aka 'long unsigned int'} to non-matching type '_Bool' [-Werror=bad-function-cast]
        125 | #define cBOOL(cbool) ((bool) (cbool))
            |                       ^
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/inline.h:2363:12: note: in expansion of macro 'cBOOL'
       2363 |     return cBOOL(is_utf8_char_helper_(s0, e, flags));
            |            ^~~~~
      In file included from /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/perl.h:7242:
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/inline.h: In function 'Perl_cop_file_avn':
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/inline.h:3489:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
       3489 |     const char *file = CopFILE(cop);
            |     ^~~~~
      In file included from /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/perl.h:7243:
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/sv_inline.h: In function 'Perl_newSV_type':
      /usr/lib/perl5/5.36.0/x86_64-linux-thread-multi/CORE/sv_inline.h:376:5: error: enumeration value 'SVt_LAST' not handled in switch [-Werror=switch-enum]
        376 |     switch (type) {
            |     ^~~~~~
    
    So disable those warnings to keep building with perl devel headers.
    
    Noticed, among other distros, on opensuse tumbleweed:
    
    gcc version 12.1.1 20220629 [revision 7811663964aa7e31c3939b859bbfa2e16919639f] (SUSE Linux)
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    63a4354a
Build 304 Bytes